示例#1
0
 /**
  * returns prior set where instance
  * @return QueryBuilderWhere
  */
 protected function getWhere()
 {
     try {
         if ($this->where instanceof QueryBuilderWhere) {
             return $this->where;
         }
         $itemType = $this->getClassVar("itemType");
         $where = new QueryBuilderWhere();
         $passwordColNames = eval("return {$itemType}::\$passwordColNames;");
         @reset($this->filter);
         $fcur = @current($this->filter);
         if (!empty($fcur) || (int) $fcur === 0) {
             if ($this->filter !== false) {
                 foreach ((array) $this->filter as $column => $value) {
                     // password columns
                     if (in_array($column, $passwordColNames)) {
                         $value = md5($value);
                     }
                     $where->addConditionColumn($column, $value);
                 }
             }
         }
         // add whereAdd addition
         if ($this->whereAdd instanceof QueryBuilderWhere) {
             $where->addWhere($this->whereAdd);
         }
         return $this->where = $where;
     } catch (Exception $e) {
         throw $e;
     }
 }