PHP Класс Adldap\Query\Builder

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$paginated boolean Determines whether the current query is paginated.

Защищенные свойства (Protected)

Свойство Тип Описание
$bindings array The query bindings.
$connection Adldap\Connections\ConnectionInterface The current connection instance.
$dn string | null The distinguished name to perform searches upon.
$grammar Grammar The current grammar instance.
$raw boolean Determines whether or not to return LDAP results in their raw array format.
$read boolean Determines whether or not to search LDAP on the base scope.
$recursive boolean Determines whether or not to search LDAP recursively.
$schema Adldap\Schemas\SchemaInterface The current schema instance.
$sortByDirection string The direction to sort the results by.
$sortByField string The field to sort search results by.
$sortByFlags integer The sort flags for sorting query results.

Открытые методы

Метод Описание
__call ( string $method, array $parameters ) : mixed Handle dynamic method calls on the query builder object to be directed to the query processor.
__construct ( Adldap\Connections\ConnectionInterface $connection, Grammar $grammar, Adldap\Schemas\SchemaInterface $schema = null ) Constructor.
addBinding ( Adldap\Query\Bindings\AbstractBinding $value, string $type = 'where' ) : Builder Adds a binding to the current query.
clearBindings ( ) : Builder Clears all query bindings.
dynamicWhere ( string $method, string $parameters ) Handles dynamic "where" clauses to the query.
find ( string $anr, array | string $columns = [] ) : mixed Finds a record using ambiguous name resolution.
findBaseDn ( ) : string | boolean Finds the Base DN of your domain controller.
findBy ( string $attribute, string $value, array | string $columns = [] ) : mixed Finds a record by the specified attribute and value.
findByDn ( string | array $dn, array | string $columns = [] ) : boolean | Model Finds a record by its distinguished name.
findByDnOrFail ( string $dn, array | string $columns = [] ) : Model Finds a record by its distinguished name.
findByOrFail ( string $attribute, string $value, array | string $columns = [] ) : mixed Finds a record by the specified attribute and value.
findBySid ( string $sid, array | string $columns = [] ) : mixed Finds a record by its Object SID.
findMany ( array $anrs = [], array $columns = [] ) : mixed Finds multiple records using ambiguous name resolution.
findManyBy ( string $attribute, array $values = [], array $columns = [] ) : mixed Finds many records by the specified attribute.
findOrFail ( string $anr, array | string $columns = [] ) : mixed Finds a record using ambiguous name resolution. If a record is not found, an exception is thrown.
first ( array | string $columns = [] ) : Model | array | null Returns the first entry in a search result.
firstOrFail ( array | string $columns = [] ) : Model Returns the first entry in a search result.
get ( ) : Collection | array Returns the current query.
getBindings ( ) : array Returns all of the query builder bindings.
getConnection ( ) : Adldap\Connections\ConnectionInterface Returns the current Connection instance.
getDn ( ) : string Returns the builders DN to perform searches upon.
getFilters ( ) : array Returns the filters on the current builder.
getGrammar ( ) : Grammar Returns the current Grammar instance.
getOrWheres ( ) : array Returns the or wheres on the current builder.
getQuery ( ) : string Compiles and returns the current query string.
getSchema ( ) : Adldap\Schemas\SchemaInterface Returns the current schema.
getSelects ( ) : array Returns the current selected fields to retrieve.
getSortByDirection ( ) : string Returns the query builders sort by direction.
getSortByField ( ) : string Returns the query builders sort by field.
getSortByFlags ( ) : integer Returns the query builders sort by flags.
getUnescapedQuery ( ) : string Returns the unescaped query.
getWheres ( ) : array Returns the wheres on the current builder.
hasSelects ( ) : boolean Returns true / false depending if the current object contains selects.
in ( string $dn ) : Builder Alias for setting the base DN of the query.
isPaginated ( ) : boolean Returns bool that determines whether the current query builder will return paginated results.
isRaw ( ) : boolean Returns bool that determines whether the current query builder will return raw results.
isSorted ( ) : boolean Returns bool that determines whether the current query builder will return sorted results.
newInstance ( ) : Builder Returns a new Query Builder instance.
orWhere ( string $field, string | null $operator = null, string | null $value = null ) : Builder Adds an or where clause to the current query.
orWhereApproximatelyEquals ( string $field, string $value ) : Builder Adds a or where approximately equals clause to the current query.
orWhereContains ( string $field, string $value ) : Builder Adds an or where contains clause to the current query.
orWhereEndsWith ( string $field, string $value ) : Builder Adds an or where ends with clause to the current query.
orWhereEquals ( string $field, string $value ) : Builder Adds an or where equals clause to the current query.
orWhereHas ( string $field ) : Builder Adds an or where has clause to the current query.
orWhereNotContains ( string $field, string $value ) : Builder Adds an or where *not* contains clause to the current query.
orWhereNotEndsWith ( string $field, string $value ) : Builder Adds an or where *not* ends with clause to the current query.
orWhereNotHas ( string $field ) : Builder Adds a where not has clause to the current query.
orWhereNotStartsWith ( string $field, string $value ) : Builder Adds an or where *not* starts with clause to the current query.
orWhereStartsWith ( string $field, string $value ) : Builder Adds an or where starts with clause to the current query.
paginate ( integer $perPage = 50, integer $currentPage, boolean $isCritical = true ) : Paginator | boolean Paginates the current LDAP query.
query ( string $query ) : Collection | array Performs the specified query on the current LDAP connection.
raw ( boolean $raw = true ) : Builder Sets the recursive property to tell the search whether or not to return the LDAP results in their raw format.
rawFilter ( array | string $filters = [] ) : Builder Adds a raw filter to the current query.
read ( boolean $read = true ) : Builder Sets the recursive property to tell the search whether or not to search on the base scope and return a single entry.
recursive ( boolean $recursive = true ) : Builder Sets the recursive property to tell the search whether or not to search recursively.
select ( array | string $fields = [] ) : Builder Adds the inserted fields to query on the current LDAP connection.
setConnection ( Adldap\Connections\ConnectionInterface $connection ) : Builder Sets the current connection.
setDn ( string | null $dn = null ) : Builder Sets the DN to perform searches upon.
setGrammar ( Grammar $grammar ) : Builder Sets the current filter grammar.
setSchema ( Adldap\Schemas\SchemaInterface $schema = null ) : Builder Sets the current schema.
sortBy ( string $field, string $direction = 'asc', integer | null $flags = null ) : Builder Sorts the LDAP search results by the specified field and direction.
where ( string | array $field, string $operator = null, string $value = null, string $type = 'and' ) : Builder Adds a where clause to the current query.
whereApproximatelyEquals ( string $field, string $value ) : Builder Adds a where approximately equals clause to the current query.
whereContains ( string $field, string $value ) : Builder Adds a where contains clause to the current query.
whereDisabled ( ) : Builder Adds a disabled filter to the current query.
whereEnabled ( ) : Builder Adds a enabled filter to the current query.
whereEndsWith ( string $field, string $value ) : Builder Adds a where ends with clause to the current query.
whereEquals ( string $field, string $value ) : Builder Adds a where equals clause to the current query.
whereHas ( string $field ) : Builder Adds a where has clause to the current query.
whereNotContains ( string $field, string $value ) : Builder Adds a where contains clause to the current query.
whereNotHas ( string $field ) : Builder Adds a where not has clause to the current query.
whereNotStartsWith ( string $field, string $value ) : Builder Adds a where *not* starts with clause to the current query.
whereStartsWith ( string $field, string $value ) : Builder Adds a where starts with clause to the current query.

Защищенные методы

Метод Описание
addDynamic ( string $segment, string $connector, array $parameters, integer $index ) : void Add a single dynamic where clause statement to the query.
newProcessor ( ) : Processor Returns a new query Processor instance.
newWhereBinding ( string $field, string $operator, string | null $value = null, string $type = 'and' ) : Where | Adldap\Query\Bindings\OrWhere Constructs a new where binding depending on the specified type.

Описание методов

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

Handle dynamic method calls on the query builder object to be directed to the query processor.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
Результат mixed

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

Constructor.
public __construct ( Adldap\Connections\ConnectionInterface $connection, Grammar $grammar, Adldap\Schemas\SchemaInterface $schema = null )
$connection Adldap\Connections\ConnectionInterface
$grammar Grammar
$schema Adldap\Schemas\SchemaInterface

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

Adds a binding to the current query.
public addBinding ( Adldap\Query\Bindings\AbstractBinding $value, string $type = 'where' ) : Builder
$value Adldap\Query\Bindings\AbstractBinding
$type string
Результат Builder

addDynamic() защищенный Метод

Add a single dynamic where clause statement to the query.
protected addDynamic ( string $segment, string $connector, array $parameters, integer $index ) : void
$segment string
$connector string
$parameters array
$index integer
Результат void

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

Clears all query bindings.
public clearBindings ( ) : Builder
Результат Builder

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

Handles dynamic "where" clauses to the query.
public dynamicWhere ( string $method, string $parameters )
$method string
$parameters string

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

Finds a record using ambiguous name resolution.
public find ( string $anr, array | string $columns = [] ) : mixed
$anr string
$columns array | string
Результат mixed

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

Finds the Base DN of your domain controller.
public findBaseDn ( ) : string | boolean
Результат string | boolean

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

Finds a record by the specified attribute and value.
public findBy ( string $attribute, string $value, array | string $columns = [] ) : mixed
$attribute string
$value string
$columns array | string
Результат mixed

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

Finds a record by its distinguished name.
public findByDn ( string | array $dn, array | string $columns = [] ) : boolean | Model
$dn string | array
$columns array | string
Результат boolean | Adldap\Models\Model

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

Fails upon no records returned.
public findByDnOrFail ( string $dn, array | string $columns = [] ) : Model
$dn string
$columns array | string
Результат Adldap\Models\Model

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

If no record is found an exception is thrown.
public findByOrFail ( string $attribute, string $value, array | string $columns = [] ) : mixed
$attribute string
$value string
$columns array | string
Результат mixed

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

Finds a record by its Object SID.
public findBySid ( string $sid, array | string $columns = [] ) : mixed
$sid string
$columns array | string
Результат mixed

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

Finds multiple records using ambiguous name resolution.
public findMany ( array $anrs = [], array $columns = [] ) : mixed
$anrs array
$columns array
Результат mixed

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

Finds many records by the specified attribute.
public findManyBy ( string $attribute, array $values = [], array $columns = [] ) : mixed
$attribute string
$values array
$columns array
Результат mixed

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

Finds a record using ambiguous name resolution. If a record is not found, an exception is thrown.
public findOrFail ( string $anr, array | string $columns = [] ) : mixed
$anr string
$columns array | string
Результат mixed

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

Returns the first entry in a search result.
public first ( array | string $columns = [] ) : Model | array | null
$columns array | string
Результат Adldap\Models\Model | array | null

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

If no entry is found, an exception is thrown.
public firstOrFail ( array | string $columns = [] ) : Model
$columns array | string
Результат Adldap\Models\Model

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

Returns the current query.
public get ( ) : Collection | array
Результат Illuminate\Support\Collection | array

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

Returns all of the query builder bindings.
public getBindings ( ) : array
Результат array

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

Returns the current Connection instance.
public getConnection ( ) : Adldap\Connections\ConnectionInterface
Результат Adldap\Connections\ConnectionInterface

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

Returns the builders DN to perform searches upon.
public getDn ( ) : string
Результат string

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

Returns the filters on the current builder.
public getFilters ( ) : array
Результат array

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

Returns the current Grammar instance.
public getGrammar ( ) : Grammar
Результат Grammar

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

Returns the or wheres on the current builder.
public getOrWheres ( ) : array
Результат array

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

Compiles and returns the current query string.
public getQuery ( ) : string
Результат string

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

Returns the current schema.
public getSchema ( ) : Adldap\Schemas\SchemaInterface
Результат Adldap\Schemas\SchemaInterface

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

Returns the current selected fields to retrieve.
public getSelects ( ) : array
Результат array

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

Returns the query builders sort by direction.
public getSortByDirection ( ) : string
Результат string

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

Returns the query builders sort by field.
public getSortByField ( ) : string
Результат string

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

Returns the query builders sort by flags.
public getSortByFlags ( ) : integer
Результат integer

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

Returns the unescaped query.
public getUnescapedQuery ( ) : string
Результат string

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

Returns the wheres on the current builder.
public getWheres ( ) : array
Результат array

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

Returns true / false depending if the current object contains selects.
public hasSelects ( ) : boolean
Результат boolean

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

Alias for setting the base DN of the query.
public in ( string $dn ) : Builder
$dn string
Результат Builder

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

Returns bool that determines whether the current query builder will return paginated results.
public isPaginated ( ) : boolean
Результат boolean

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

Returns bool that determines whether the current query builder will return raw results.
public isRaw ( ) : boolean
Результат boolean

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

Returns bool that determines whether the current query builder will return sorted results.
public isSorted ( ) : boolean
Результат boolean

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

Returns a new Query Builder instance.
public newInstance ( ) : Builder
Результат Builder

newProcessor() защищенный Метод

Returns a new query Processor instance.
protected newProcessor ( ) : Processor
Результат Processor

newWhereBinding() защищенный Метод

Constructs a new where binding depending on the specified type.
protected newWhereBinding ( string $field, string $operator, string | null $value = null, string $type = 'and' ) : Where | Adldap\Query\Bindings\OrWhere
$field string
$operator string
$value string | null
$type string
Результат Adldap\Query\Bindings\Where | Adldap\Query\Bindings\OrWhere

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

Adds an or where clause to the current query.
public orWhere ( string $field, string | null $operator = null, string | null $value = null ) : Builder
$field string
$operator string | null
$value string | null
Результат Builder

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

Adds a or where approximately equals clause to the current query.
public orWhereApproximatelyEquals ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Adds an or where contains clause to the current query.
public orWhereContains ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Adds an or where ends with clause to the current query.
public orWhereEndsWith ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Adds an or where equals clause to the current query.
public orWhereEquals ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Adds an or where has clause to the current query.
public orWhereHas ( string $field ) : Builder
$field string
Результат Builder

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

Adds an or where *not* contains clause to the current query.
public orWhereNotContains ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Adds an or where *not* ends with clause to the current query.
public orWhereNotEndsWith ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Adds a where not has clause to the current query.
public orWhereNotHas ( string $field ) : Builder
$field string
Результат Builder

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

Adds an or where *not* starts with clause to the current query.
public orWhereNotStartsWith ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Adds an or where starts with clause to the current query.
public orWhereStartsWith ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Paginates the current LDAP query.
public paginate ( integer $perPage = 50, integer $currentPage, boolean $isCritical = true ) : Paginator | boolean
$perPage integer
$currentPage integer
$isCritical boolean
Результат Adldap\Objects\Paginator | boolean

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

Performs the specified query on the current LDAP connection.
public query ( string $query ) : Collection | array
$query string
Результат Illuminate\Support\Collection | array

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

Sets the recursive property to tell the search whether or not to return the LDAP results in their raw format.
public raw ( boolean $raw = true ) : Builder
$raw boolean
Результат Builder

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

Adds a raw filter to the current query.
public rawFilter ( array | string $filters = [] ) : Builder
$filters array | string
Результат Builder

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

Sets the recursive property to tell the search whether or not to search on the base scope and return a single entry.
public read ( boolean $read = true ) : Builder
$read boolean
Результат Builder

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

Sets the recursive property to tell the search whether or not to search recursively.
public recursive ( boolean $recursive = true ) : Builder
$recursive boolean
Результат Builder

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

Adds the inserted fields to query on the current LDAP connection.
public select ( array | string $fields = [] ) : Builder
$fields array | string
Результат Builder

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

Sets the current connection.
public setConnection ( Adldap\Connections\ConnectionInterface $connection ) : Builder
$connection Adldap\Connections\ConnectionInterface
Результат Builder

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

Sets the DN to perform searches upon.
public setDn ( string | null $dn = null ) : Builder
$dn string | null
Результат Builder

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

Sets the current filter grammar.
public setGrammar ( Grammar $grammar ) : Builder
$grammar Grammar
Результат Builder

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

Sets the current schema.
public setSchema ( Adldap\Schemas\SchemaInterface $schema = null ) : Builder
$schema Adldap\Schemas\SchemaInterface
Результат Builder

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

Sorts the LDAP search results by the specified field and direction.
public sortBy ( string $field, string $direction = 'asc', integer | null $flags = null ) : Builder
$field string
$direction string
$flags integer | null
Результат Builder

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

Adds a where clause to the current query.
public where ( string | array $field, string $operator = null, string $value = null, string $type = 'and' ) : Builder
$field string | array
$operator string
$value string
$type string
Результат Builder

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

Adds a where approximately equals clause to the current query.
public whereApproximatelyEquals ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Adds a where contains clause to the current query.
public whereContains ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Adds a disabled filter to the current query.
public whereDisabled ( ) : Builder
Результат Builder

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

Adds a enabled filter to the current query.
public whereEnabled ( ) : Builder
Результат Builder

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

Adds a where ends with clause to the current query.
public whereEndsWith ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Adds a where equals clause to the current query.
public whereEquals ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Adds a where has clause to the current query.
public whereHas ( string $field ) : Builder
$field string
Результат Builder

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

Adds a where contains clause to the current query.
public whereNotContains ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Adds a where not has clause to the current query.
public whereNotHas ( string $field ) : Builder
$field string
Результат Builder

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

Adds a where *not* starts with clause to the current query.
public whereNotStartsWith ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

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

Adds a where starts with clause to the current query.
public whereStartsWith ( string $field, string $value ) : Builder
$field string
$value string
Результат Builder

Описание свойств

$bindings защищенное свойство

The query bindings.
protected array $bindings
Результат array

$connection защищенное свойство

The current connection instance.
protected ConnectionInterface,Adldap\Connections $connection
Результат Adldap\Connections\ConnectionInterface

$dn защищенное свойство

The distinguished name to perform searches upon.
protected string|null $dn
Результат string | null

$grammar защищенное свойство

The current grammar instance.
protected Grammar,Adldap\Query $grammar
Результат Grammar

$paginated публичное свойство

Determines whether the current query is paginated.
public bool $paginated
Результат boolean

$raw защищенное свойство

Determines whether or not to return LDAP results in their raw array format.
protected bool $raw
Результат boolean

$read защищенное свойство

Determines whether or not to search LDAP on the base scope.
protected bool $read
Результат boolean

$recursive защищенное свойство

Determines whether or not to search LDAP recursively.
protected bool $recursive
Результат boolean

$schema защищенное свойство

The current schema instance.
protected SchemaInterface,Adldap\Schemas $schema
Результат Adldap\Schemas\SchemaInterface

$sortByDirection защищенное свойство

The direction to sort the results by.
protected string $sortByDirection
Результат string

$sortByField защищенное свойство

The field to sort search results by.
protected string $sortByField
Результат string

$sortByFlags защищенное свойство

The sort flags for sorting query results.
protected int $sortByFlags
Результат integer