Beispiel #1
0
 private function checkAny($val, $op, $coalesce = false)
 {
     if ($this->_field == "any") {
         if (in_array("any.any", $this->_ancestor->_fields)) {
             $f = new Default_Model_FilterItem("any.any", $this->_ancestor);
             $f->{$op}($val, $coalesce);
             $this->_expr = "(" . $f->expr() . ")";
         } else {
             $s = array();
             foreach ($this->_ancestor->_fields as $field) {
                 if (array_key_exists($field, $this->_ancestor->_fieldTypes) && ($this->_ancestor->_fieldTypes[$field] == 'string' || $this->_ancestor->_fieldTypes[$field] == 'string[]' || $field == "id")) {
                     if ($field !== "any.any") {
                         $f = new Default_Model_FilterItem($field, $this->_ancestor);
                         $f->{$op}($val, $coalesce);
                         $s[] = $f->expr();
                     }
                 }
             }
             $this->_expr = "(" . implode($s, " OR ") . ")";
         }
         return true;
     } else {
         return false;
     }
 }