本文整理匯總了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);
}