PHP Класс LdapTools\Query\LdapQueryBuilder

Автор: Chad Sikorra ([email protected])
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$baseAnd The base 'And' operator when the method 'where' or 'andWhere' is used.
$baseOr The base 'Or' operator when the method 'orWhere' is used.
$connection The LDAP connection.
$filterBuilder LdapTools\Query\Builder\FilterBuilder | LdapTools\Query\Builder\ADFilterBuilder
$hydrator LdapTools\Hydrator\OperationHydrator
$operation The operation that will eventually be sent to the LDAP connection.
$orderBy The attributes to order by, if any. They will be in ['attribute' => 'ASC'] form.
$schemaFactory LdapTools\Factory\LdapObjectSchemaFactory

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

Метод Описание
__call ( string $method, array $arguments ) : mixed Determines which function, if any, should be called.
__construct ( LdapTools\Connection\LdapConnectionInterface $connection = null, LdapObjectSchemaFactory $schemaFactory = null )
add ( variadic $operators ) Add an operator object to the query.
addControl ( variadic $controls ) Add LDAP controls to be used for the query.
addOrderBy ( string $attribute, string $direction ) Add an attribute to be ordered for the returned results and set the direction for the ordering.
andWhere ( $whereStatements ) Adds additional operators or equality comparisons to the 'and' statement.
filter ( ) : FilterBuilder | ADFilterBuilder Call this to help build additional query statements in an object-oriented fashion.
from ( mixed $type, null | string $alias = null ) Add object types used to narrow the query. This can either be a string name representing the object type from the schema, such as 'user' or 'group' or you can pass the LdapObjectSchema for the type. If you are using this class without a schema then construct the query manually by just using the "where" and "andWhere" methods.
fromGroups ( string | null $alias = null ) A convenience method to select from group object types.
fromOUs ( string | null $alias = null ) A convenience method to select from OU object types.
fromUsers ( string | null $alias = null ) A convenience method to select from user object types.
getAttributes ( ) : array Get the attributes selected for this query.
getBaseDn ( ) : string Get the base DN for the query.
getLdapFilter ( ) : string Get the LDAP filter formed by this query.
getLdapQuery ( ) : LdapQuery Get the LdapQuery object based on the constructed filter and parameters in this builder.
getPageSize ( ) : integer Get the page size for the query.
getScope ( ) : string Get the scope for the query (ie. subtree, onelevel, base).
getServer ( ) : null | string Get the specific LDAP server that the query should be run on, if any is set.
getSizeLimit ( ) : integer Get the size limit for the amount of results returned from LDAP for the query.
getUsePaging ( ) : boolean Get whether or not paging should be used for the query.
orWhere ( $whereStatements ) Create a logical 'or' from the passed arguments. Either pass a key => value array with attribute names and expected values (which will be compared in terms of equality) or pass arbitrary Operator objects using the 'filter' method shortcuts or some other way.
orderBy ( string $attribute, string $direction ) Set the attribute to order by. This will override anything already explicitly set to be ordered. To order on multiple attributes use 'addOrderBy', which allows the attribute ordering to stack.
select ( string | array $attributes = [] ) Set the attributes to select from the object. Either specify a single attribute as a string or an array of attribute names.
setBaseDn ( string $baseDn ) Sets the base DN for the query.
setPageSize ( integer $pageSize ) Set the page size for the query.
setScope ( string $scope ) Set the scope using the QueryOperation::SCOPE constant.
setScopeBase ( ) Set the scope of the query to only the entry defined by the baseDn.
setScopeOneLevel ( ) Set the scope of the query to search only the entries within the baseDn but none of its children.
setScopeSubTree ( ) Set the scope of the query to search the complete the baseDn and all children.
setServer ( string $server ) Set a specific LDAP server to run the query on.
setSizeLimit ( integer $sizeLimit ) Set the size limit for the amount of results returned from LDAP for the query.
setUsePaging ( boolean $usePaging ) Set whether or not paging should be used for the query.
toLdapFilter ( ) : string Get the LDAP filter formed by this query.
where ( $whereStatements ) Create a logical 'and' from the passed statements. Either pass a key => value array with attribute names and expected values (which will be compared in terms of equality) or pass arbitrary Operator objects using the 'filter' method shortcuts or some other way.

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

Метод Описание
addBaseAndIfNotExists ( ) Adds a base 'bAnd' operator for the convenience 'where', 'andWhere' methods only if it does not already exist.
addBaseOrIfNotExists ( ) Adds a base 'bOr' operator for the convenience 'orWhere' method only if it does not already exist.
getSchemaFromType ( string | LdapObjectSchema $type ) : LdapObjectSchema

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

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

Determines which function, if any, should be called.
public __call ( string $method, array $arguments ) : mixed
$method string
$arguments array
Результат mixed

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

public __construct ( LdapTools\Connection\LdapConnectionInterface $connection = null, LdapObjectSchemaFactory $schemaFactory = null )
$connection LdapTools\Connection\LdapConnectionInterface
$schemaFactory LdapTools\Factory\LdapObjectSchemaFactory

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

Add an operator object to the query.
public add ( variadic $operators )
$operators variadic

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

Adds a base 'bAnd' operator for the convenience 'where', 'andWhere' methods only if it does not already exist.
protected addBaseAndIfNotExists ( )

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

Adds a base 'bOr' operator for the convenience 'orWhere' method only if it does not already exist.
protected addBaseOrIfNotExists ( )

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

Add LDAP controls to be used for the query.
public addControl ( variadic $controls )
$controls variadic

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

Add an attribute to be ordered for the returned results and set the direction for the ordering.
public addOrderBy ( string $attribute, string $direction )
$attribute string The attribute name
$direction string Either 'ASC' or 'DESC'. Defaults to 'ASC'.

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

Adds additional operators or equality comparisons to the 'and' statement.
См. также: where
public andWhere ( $whereStatements )
$whereStatements Either a key => value array or an Operator type objects.

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

Call this to help build additional query statements in an object-oriented fashion.
public filter ( ) : FilterBuilder | ADFilterBuilder
Результат LdapTools\Query\Builder\FilterBuilder | LdapTools\Query\Builder\ADFilterBuilder

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

Add object types used to narrow the query. This can either be a string name representing the object type from the schema, such as 'user' or 'group' or you can pass the LdapObjectSchema for the type. If you are using this class without a schema then construct the query manually by just using the "where" and "andWhere" methods.
public from ( mixed $type, null | string $alias = null )
$type mixed The string schema type name or a LdapObjectSchema
$alias null | string The alias name to refer to the type being selected

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

A convenience method to select from group object types.
public fromGroups ( string | null $alias = null )
$alias string | null

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

A convenience method to select from OU object types.
public fromOUs ( string | null $alias = null )
$alias string | null

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

A convenience method to select from user object types.
public fromUsers ( string | null $alias = null )
$alias string | null

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

Get the attributes selected for this query.
public getAttributes ( ) : array
Результат array

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

Get the base DN for the query.
public getBaseDn ( ) : string
Результат string

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

Get the LDAP filter formed by this query.
Устаревший: This will be removed in a future version. Use the "toLdapFilter()" method instead.
public getLdapFilter ( ) : string
Результат string

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

Get the LdapQuery object based on the constructed filter and parameters in this builder.
public getLdapQuery ( ) : LdapQuery
Результат LdapQuery

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

Get the page size for the query.
public getPageSize ( ) : integer
Результат integer

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

protected getSchemaFromType ( string | LdapObjectSchema $type ) : LdapObjectSchema
$type string | LdapTools\Schema\LdapObjectSchema
Результат LdapTools\Schema\LdapObjectSchema

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

Get the scope for the query (ie. subtree, onelevel, base).
public getScope ( ) : string
Результат string

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

Get the specific LDAP server that the query should be run on, if any is set.
public getServer ( ) : null | string
Результат null | string

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

Get the size limit for the amount of results returned from LDAP for the query.
public getSizeLimit ( ) : integer
Результат integer

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

Get whether or not paging should be used for the query.
public getUsePaging ( ) : boolean
Результат boolean

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

Create a logical 'or' from the passed arguments. Either pass a key => value array with attribute names and expected values (which will be compared in terms of equality) or pass arbitrary Operator objects using the 'filter' method shortcuts or some other way.
public orWhere ( $whereStatements )
$whereStatements Either a key => value array or an Operator type objects.

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

Set the attribute to order by. This will override anything already explicitly set to be ordered. To order on multiple attributes use 'addOrderBy', which allows the attribute ordering to stack.
public orderBy ( string $attribute, string $direction )
$attribute string The attribute name
$direction string Either 'ASC' or 'DESC'. Defaults to 'ASC'.

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

Set the attributes to select from the object. Either specify a single attribute as a string or an array of attribute names.
public select ( string | array $attributes = [] )
$attributes string | array

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

Sets the base DN for the query.
public setBaseDn ( string $baseDn )
$baseDn string

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

Set the page size for the query.
public setPageSize ( integer $pageSize )
$pageSize integer

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

Set the scope using the QueryOperation::SCOPE constant.
public setScope ( string $scope )
$scope string

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

Set the scope of the query to only the entry defined by the baseDn.
public setScopeBase ( )

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

Set the scope of the query to search only the entries within the baseDn but none of its children.
public setScopeOneLevel ( )

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

Set the scope of the query to search the complete the baseDn and all children.
public setScopeSubTree ( )

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

Set a specific LDAP server to run the query on.
public setServer ( string $server )
$server string

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

Set the size limit for the amount of results returned from LDAP for the query.
public setSizeLimit ( integer $sizeLimit )
$sizeLimit integer

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

Set whether or not paging should be used for the query.
public setUsePaging ( boolean $usePaging )
$usePaging boolean

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

Get the LDAP filter formed by this query.
public toLdapFilter ( ) : string
Результат string

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

Create a logical 'and' from the passed statements. Either pass a key => value array with attribute names and expected values (which will be compared in terms of equality) or pass arbitrary Operator objects using the 'filter' method shortcuts or some other way.
public where ( $whereStatements )
$whereStatements Either a key => value array or an Operator type objects.

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

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

The base 'And' operator when the method 'where' or 'andWhere' is used.
protected $baseAnd

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

The base 'Or' operator when the method 'orWhere' is used.
protected $baseOr

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

The LDAP connection.
protected $connection

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

protected FilterBuilder,LdapTools\Query\Builder|ADFilterBuilder,LdapTools\Query\Builder $filterBuilder
Результат LdapTools\Query\Builder\FilterBuilder | LdapTools\Query\Builder\ADFilterBuilder

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

protected OperationHydrator,LdapTools\Hydrator $hydrator
Результат LdapTools\Hydrator\OperationHydrator

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

The operation that will eventually be sent to the LDAP connection.
protected $operation

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

The attributes to order by, if any. They will be in ['attribute' => 'ASC'] form.
protected $orderBy

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

protected LdapObjectSchemaFactory,LdapTools\Factory $schemaFactory
Результат LdapTools\Factory\LdapObjectSchemaFactory