本文整理汇总了PHP中Illuminate\Database\Query\Builder::addNestedWhereQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP Builder::addNestedWhereQuery方法的具体用法?PHP Builder::addNestedWhereQuery怎么用?PHP Builder::addNestedWhereQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Database\Query\Builder
的用法示例。
在下文中一共展示了Builder::addNestedWhereQuery方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: where
/**
* 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;
}
示例2: where
/**
* 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;
}
示例3: addNestedWhereQuery
/**
* 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);
}