Example #1
0
 /**
  * Get/Set an "AND WHERE" clause on the query. You can either pass a simple
  * comparison ('name', '=', 'Alex') or a function to append multiple queries
  * in a group.
  *
  * @param   string|\Closure|null    $field      Fieldname|callback for group|to return
  * @param   string|null             $operator   Operator (=, !=, <>, <= etc)
  * @param   mixed|null              $value      Value to test against
  * @return  $this|array                         $this on set, array on get
  */
 public function where($field = null, $operator = null, $value = null)
 {
     if (!isset($this->whereBuilder)) {
         $this->whereBuilder = new ConditionBuilder();
     }
     if ($field == null) {
         return $this->whereBuilder->conditions();
     }
     $this->whereBuilder->andWith($field, $operator, $value);
     return $this;
 }