Illuminate\Database\Query\Builder::addWhereExistsQuery PHP Method

addWhereExistsQuery() public method

Add an exists clause to the query.
public addWhereExistsQuery ( Builder $query, string $boolean = 'and', boolean $not = false )
$query Builder
$boolean string
$not boolean
    public function addWhereExistsQuery(Builder $query, $boolean = 'and', $not = false)
    {
        $type = $not ? 'NotExists' : 'Exists';
        $this->wheres[] = compact('type', 'operator', 'query', 'boolean');
        $this->addBinding($query->getBindings(), 'where');
        return $this;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Add an exists clause to the query.
  *
  * @param \Illuminate\Database\Query\Builder $query
  * @param string $boolean
  * @param bool $not
  * @return $this 
  * @static 
  */
 public static function addWhereExistsQuery($query, $boolean = 'and', $not = false)
 {
     return \Illuminate\Database\Query\Builder::addWhereExistsQuery($query, $boolean, $not);
 }