PHP 클래스 LdapTools\Query\LdapQuery

저자: Chad Sikorra ([email protected])
상속: use trait LdapTools\Hydrator\HydrateQueryTrait
파일 보기 프로젝트 열기: ldaptools/ldaptools 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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.

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[]