Pagekit\Database\Query\QueryBuilder::whereExists PHP Метод

whereExists() публичный Метод

Creates and adds a "where exists" to the query.
public whereExists ( Closure $callback, boolean $not = false, string $type = null ) : self
$callback Closure
$not boolean
$type string
Результат self
    public function whereExists(Closure $callback, $not = false, $type = null)
    {
        $query = $this->newQuery();
        call_user_func($callback, $query);
        $exists = $query->getSQL();
        $not = $not ? 'NOT ' : '';
        return $this->addWhere("{$not}EXISTS ({$exists})", $query->params(), $type);
    }