getAll(); $ops = array(); $cond_res = array(); for ($i = 0 ; $i < count($filter); $i++) { $cond = $filter[$i]; $cond_res[$i] = $this->getCondResult($cond); $ops[$i] = $cond['logical']; } for ($i = 1; $i < count($cond_res); $i++) { if ($ops[$i] != 'and') continue; $cond_res[$i-1] = $this->andOp($cond_res[$i-1],$cond_res[$i]); array_splice($cond_res, $i, 1); array_splice($ops, $i, 1); $i--; } for ($i = 1; $i < count($cond_res); $i++) { if ($ops[$i] != 'or') continue; $cond_res[$i-1] = $this->orOp($cond_res[$i-1],$cond_res[$i]); array_splice($cond_res, $i, 1); array_splice($ops, $i, 1); $i--; } return $cond_res[0]; } } ?>