예제 #1
0
 public function or_($op1, $operator = '', $op2 = NULL)
 {
     if ($op1 instanceof ConditionCriteria) {
         $this->addOr($op1);
     } else {
         $base = new PersistentCondition($op1, $operator, $op2);
         $base->setCriteria($this->criteria);
         $this->addOr($base);
     }
     return $this;
 }
예제 #2
0
 public function getCondition($op1, $operator = '', $op2 = NULL)
 {
     $criteria = new ConditionCriteria();
     if ($op1 instanceof ConditionCriteria) {
         $criteria->add($op1);
     } elseif ($op1 instanceof PersistentCondition) {
         $criteria->add($op1);
     } else {
         $base = new PersistentCondition($op1, $operator, $op2);
         $base->setCriteria($criteria);
         $criteria->add($base);
     }
     return $criteria;
 }
예제 #3
0
 private function convertMultiCriteria($condition, &$criteriaCondition)
 {
     if (is_array($condition)) {
         foreach ($condition as $c) {
             if (is_array($c[1])) {
                 $cc = new ConditionCriteria();
                 $this->convertMultiCriteria($c[1], $cc);
                 $criteriaCondition->add($cc, $c[0]);
             } else {
                 $base = new PersistentCondition($c[1], $c[2], $c[3]);
                 $base->setCriteria($this);
                 $criteriaCondition->add($base, $c[0]);
             }
         }
     }
 }