예제 #1
0
파일: Where.php 프로젝트: ZhuJingfa/HuiLib
 /**
  * 跟另外一个条件组成or条件
  */
 public function orCase(Where $where, $hand = self::HAND_RIGHT)
 {
     if ($this->orObject === NUll) {
         $this->orObject = $where;
         $this->orHand = $hand;
     } else {
         //给动态插入到后面的
         $this->orObject->orCase($where, $hand);
     }
     return $this;
 }
예제 #2
0
파일: Query.php 프로젝트: ZhuJingfa/HuiLib
 /**
  * 设置Where条件
  * 
  * Select/Delete/Update用到
  *
  * KVpair、plainQuote、nameBind三种模式,具体见Where类
  *
  * @param \HuiLib\Db\Query\Where $where where条件对象
  *
  * @return \HuiLib\Db\Query
  */
 public function where(Query\Where $where, $case = 'and')
 {
     $this->setAdapter();
     if ($this->where === NULL) {
         $this->where = $where;
     } else {
         if ($case == self::WHERE_AND) {
             $this->where->andCase($where);
         } else {
             $this->where->orCase($where);
         }
     }
     $this->where->setQuery($this);
     return $this;
 }