/** * 跟另外一个条件组成and条件 */ public function andCase(Where $where, $hand = self::HAND_RIGHT) { if ($this->andObject === NUll) { $this->andObject = $where; $this->andHand = $hand; } else { //给动态插入到后面的 $this->andObject->andCase($where, $hand); } return $this; }
/** * 设置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; }