Add another query builder as a nested where to the query builder.
public addNestedWhereQuery ( |
||
$query | ||
$boolean | string |
/** * Add a basic where clause to the query. * * @param string $column * @param string $operator * @param mixed $value * @param string $boolean * @return \Illuminate\Database\Eloquent\Builder|static */ public function where($column, $operator = null, $value = null, $boolean = 'and') { if ($column instanceof Closure) { $query = $this->model->newQuery(); call_user_func($column, $query); $this->query->addNestedWhereQuery($query->getQuery(), $boolean); } else { $this->query->where($column, $operator, $value, $boolean); } return $this; }
/** * Add a basic where clause to the query. * * @param string $column * @param string $operator * @param mixed $value * @param string $boolean * @return $this */ public function where($column, $operator = null, $value = null, $boolean = 'and') { if ($column instanceof Closure) { $query = $this->model->newQueryWithoutScopes(); call_user_func($column, $query); $this->query->addNestedWhereQuery($query->getQuery(), $boolean); } else { call_user_func_array(array($this->query, 'where'), func_get_args()); } return $this; }
/** * Add another query builder as a nested where to the query builder. * * @param \Illuminate\Database\Query\Builder|static $query * @param string $boolean * @return $this * @static */ public static function addNestedWhereQuery($query, $boolean = 'and') { return \Illuminate\Database\Query\Builder::addNestedWhereQuery($query, $boolean); }