PHP 클래스 LdapTools\Query\LdapResultSorter

저자: Chad Sikorra ([email protected])
파일 보기 프로젝트 열기: ldaptools/ldaptools

보호된 프로퍼티들

프로퍼티 타입 설명
$aliases LdapTools\Schema\LdapObjectSchema[]
$caseSensitive boolean
$orderBy array

공개 메소드들

메소드 설명
__construct ( array $orderBy = [], array $aliases = [] )
getIsCaseSensitive ( ) : boolean Get whether or not the results will be sorted case-sensitive.
setIsCaseSensitive ( boolean $caseSensitive ) Set whether or not the results will be sorted case-sensitive.
sort ( array | LdapObjectCollection $results ) : array | LdapObjectCollection Reorganize the array to the desired orderBy methods passed to the class.

보호된 메소드들

메소드 설명
compare ( string $value1, string $value2 ) : integer Taking into account case-sensitivity compare the 2 string values.
convertValueToString ( mixed $value ) : string Certain cases may require the value to be specifically changed to a string, as not every object has default string representation. The most common wanting to be sorted would likely be a DateTime object.
getComparisonValue ( array | LdapObject $entry, string $attribute ) : mixed Determine how to get the value for the attribute from the LDAP entry being compared, and return that value.
getUsortReturnValue ( string $attribute, string $direction, array | LdapObject $a, array | LdapObject $b ) : integer Based on the attribute and direction, compare the LDAP objects to get a return value for usort.
resultSortCallback ( mixed $a, mixed $b ) : integer Goes through each orderBy value to run a comparison to determine the value to pass back to usort.

메소드 상세

__construct() 공개 메소드

public __construct ( array $orderBy = [], array $aliases = [] )
$orderBy array
$aliases array The aliases used, if any (in the form of ['alias' => LdapObjectSchema])

compare() 보호된 메소드

Taking into account case-sensitivity compare the 2 string values.
protected compare ( string $value1, string $value2 ) : integer
$value1 string
$value2 string
리턴 integer

convertValueToString() 보호된 메소드

Certain cases may require the value to be specifically changed to a string, as not every object has default string representation. The most common wanting to be sorted would likely be a DateTime object.
protected convertValueToString ( mixed $value ) : string
$value mixed
리턴 string

getComparisonValue() 보호된 메소드

Determine how to get the value for the attribute from the LDAP entry being compared, and return that value.
protected getComparisonValue ( array | LdapObject $entry, string $attribute ) : mixed
$entry array | LdapTools\Object\LdapObject
$attribute string
리턴 mixed

getIsCaseSensitive() 공개 메소드

Get whether or not the results will be sorted case-sensitive.
public getIsCaseSensitive ( ) : boolean
리턴 boolean

getUsortReturnValue() 보호된 메소드

Based on the attribute and direction, compare the LDAP objects to get a return value for usort.
protected getUsortReturnValue ( string $attribute, string $direction, array | LdapObject $a, array | LdapObject $b ) : integer
$attribute string
$direction string
$a array | LdapTools\Object\LdapObject
$b array | LdapTools\Object\LdapObject
리턴 integer

resultSortCallback() 보호된 메소드

Goes through each orderBy value to run a comparison to determine the value to pass back to usort.
protected resultSortCallback ( mixed $a, mixed $b ) : integer
$a mixed
$b mixed
리턴 integer

setIsCaseSensitive() 공개 메소드

Set whether or not the results will be sorted case-sensitive.
public setIsCaseSensitive ( boolean $caseSensitive )
$caseSensitive boolean

sort() 공개 메소드

Reorganize the array to the desired orderBy methods passed to the class.
public sort ( array | LdapObjectCollection $results ) : array | LdapObjectCollection
$results array | LdapTools\Object\LdapObjectCollection The unsorted result set.
리턴 array | LdapTools\Object\LdapObjectCollection The sorted result set.

프로퍼티 상세

$aliases 보호되어 있는 프로퍼티

protected LdapObjectSchema[],LdapTools\Schema $aliases
리턴 LdapTools\Schema\LdapObjectSchema[]

$caseSensitive 보호되어 있는 프로퍼티

protected bool $caseSensitive
리턴 boolean

$orderBy 보호되어 있는 프로퍼티

protected array $orderBy
리턴 array