PHP Класс LdapTools\Query\LdapQuery

Автор: Chad Sikorra ([email protected])
Наследование: use trait LdapTools\Hydrator\HydrateQueryTrait
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$caseSensitive boolean
$hydratorFactory LdapTools\Factory\HydratorFactory
$ldap LdapTools\Connection\LdapConnectionInterface
$operation LdapTools\Operation\QueryOperation | null
$orderBy The attributes to order by, if any. They will be in ['attribute' => 'ASC'] form.
$schemas LdapTools\Schema\LdapObjectSchema[]

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

Метод Описание
__construct ( LdapTools\Connection\LdapConnectionInterface $ldap )
execute ( string $hydratorType = HydratorFactory::TO_OBJECT ) : mixed Execute a query based on the set parameters. Optionally choose a mode to hydrate the results in.
getArrayResult ( ) : array This is an alias for the execute() method with an implied array hydration type. This executes the query against LDAP and returns the results as an array instead of objects.
getIsCaseSensitiveSort ( ) : boolean Get whether or not the results should be sorted in a case-sensitive way.
getOneOrNullResult ( string $hydratorType = HydratorFactory::TO_OBJECT ) : array | LdapObject | null This behaves very similar to getSingleResult(), only if no results are found it will return null instead of throwing an exception.
getOrderBy ( ) : array Get the attributes to order the results by.
getQueryOperation ( ) : QueryOperation | null Get the query operation that will run against LDAP.
getResult ( string $hydratorType = HydratorFactory::TO_OBJECT ) : mixed This is an alias for the execute() method. This executes the query against LDAP and returns the result.
getSingleResult ( string $hydratorType = HydratorFactory::TO_OBJECT ) : array | LdapObject Retrieve a single unique result from LDAP. If the result is empty or contains more than one entry, an exception is thrown.
getSingleScalarOrNullResult ( ) : mixed This behaves very similar to getSingleScalarResult(), only if the attribute is not found it will return null instead of throwing an exception.
getSingleScalarResult ( ) : mixed Retrieve a single selected attribute value from LDAP.
setIsCaseSensitiveSort ( boolean $caseSensitive ) Set whether or not the results should be sorted in a case-sensitive way.
setOrderBy ( array $orderBy ) Set the attributes to order the results by.
setQueryOperation ( QueryOperation $operation ) Set the query operation to run against LDAP.

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

Метод Описание
getFormattedOrderBy ( $selected, $aliases ) : array This formats the orderBy array to ignore case differences between the orderBy name and the actually selected name, such as for sorting arrays.
getResultsForAliases ( string $hydratorType ) : array | LdapObjectCollection | mixed Goes through each alias for the operation to get results only for that specific type, then combine and return them all.
getResultsFromLdap ( QueryOperation $operation, string $hydratorType, null | LdapObjectSchema $schema = null, null | string $alias = null ) : mixed
getSelectedForAllAliases ( array $aliases ) : array Get all the attributes that were selected for the query taking into account all of the aliases used.
sortResults ( mixed $results ) : mixed

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

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

public __construct ( LdapTools\Connection\LdapConnectionInterface $ldap )
$ldap LdapTools\Connection\LdapConnectionInterface

execute() публичный метод

Execute a query based on the set parameters. Optionally choose a mode to hydrate the results in.
public execute ( string $hydratorType = HydratorFactory::TO_OBJECT ) : mixed
$hydratorType string A hyrdrator type constant from the factory.
Результат mixed

getArrayResult() публичный метод

This is an alias for the execute() method with an implied array hydration type. This executes the query against LDAP and returns the results as an array instead of objects.
public getArrayResult ( ) : array
Результат array

getFormattedOrderBy() защищенный метод

This formats the orderBy array to ignore case differences between the orderBy name and the actually selected name, such as for sorting arrays.
protected getFormattedOrderBy ( $selected, $aliases ) : array
$selected
$aliases
Результат array

getIsCaseSensitiveSort() публичный метод

Get whether or not the results should be sorted in a case-sensitive way.
public getIsCaseSensitiveSort ( ) : boolean
Результат boolean

getOneOrNullResult() публичный метод

This behaves very similar to getSingleResult(), only if no results are found it will return null instead of throwing an exception.
public getOneOrNullResult ( string $hydratorType = HydratorFactory::TO_OBJECT ) : array | LdapObject | null
$hydratorType string
Результат array | LdapTools\Object\LdapObject | null

getOrderBy() публичный метод

Get the attributes to order the results by.
public getOrderBy ( ) : array
Результат array

getQueryOperation() публичный метод

Get the query operation that will run against LDAP.
public getQueryOperation ( ) : QueryOperation | null
Результат LdapTools\Operation\QueryOperation | null

getResult() публичный метод

This is an alias for the execute() method. This executes the query against LDAP and returns the result.
public getResult ( string $hydratorType = HydratorFactory::TO_OBJECT ) : mixed
$hydratorType string A hyrdrator type constant from the factory.
Результат mixed

getResultsForAliases() защищенный метод

Goes through each alias for the operation to get results only for that specific type, then combine and return them all.
protected getResultsForAliases ( string $hydratorType ) : array | LdapObjectCollection | mixed
$hydratorType string
Результат array | LdapTools\Object\LdapObjectCollection | mixed

getResultsFromLdap() защищенный метод

protected getResultsFromLdap ( QueryOperation $operation, string $hydratorType, null | LdapObjectSchema $schema = null, null | string $alias = null ) : mixed
$operation LdapTools\Operation\QueryOperation
$hydratorType string
$schema null | LdapTools\Schema\LdapObjectSchema
$alias null | string
Результат mixed

getSelectedForAllAliases() защищенный метод

Get all the attributes that were selected for the query taking into account all of the aliases used.
protected getSelectedForAllAliases ( array $aliases ) : array
$aliases array
Результат array

getSingleResult() публичный метод

Retrieve a single unique result from LDAP. If the result is empty or contains more than one entry, an exception is thrown.
public getSingleResult ( string $hydratorType = HydratorFactory::TO_OBJECT ) : array | LdapObject
$hydratorType string A hyrdrator type constant from the factory.
Результат array | LdapTools\Object\LdapObject

getSingleScalarOrNullResult() публичный метод

This behaves very similar to getSingleScalarResult(), only if the attribute is not found it will return null instead of throwing an exception.
public getSingleScalarOrNullResult ( ) : mixed
Результат mixed

getSingleScalarResult() публичный метод

Retrieve a single selected attribute value from LDAP.
public getSingleScalarResult ( ) : mixed
Результат mixed

setIsCaseSensitiveSort() публичный метод

Set whether or not the results should be sorted in a case-sensitive way.
public setIsCaseSensitiveSort ( boolean $caseSensitive )
$caseSensitive boolean

setOrderBy() публичный метод

Set the attributes to order the results by.
public setOrderBy ( array $orderBy )
$orderBy array In the form of ['attribute' => 'ASC', ...]

setQueryOperation() публичный метод

Set the query operation to run against LDAP.
public setQueryOperation ( QueryOperation $operation )
$operation LdapTools\Operation\QueryOperation

sortResults() защищенный метод

protected sortResults ( mixed $results ) : mixed
$results mixed
Результат mixed $results

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

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

protected bool $caseSensitive
Результат boolean

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

protected HydratorFactory,LdapTools\Factory $hydratorFactory
Результат LdapTools\Factory\HydratorFactory

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

protected LdapConnectionInterface,LdapTools\Connection $ldap
Результат LdapTools\Connection\LdapConnectionInterface

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

protected QueryOperation,LdapTools\Operation|null $operation
Результат LdapTools\Operation\QueryOperation | null

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

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

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

protected LdapObjectSchema[],LdapTools\Schema $schemas
Результат LdapTools\Schema\LdapObjectSchema[]