PHP Class LdapTools\Query\OperatorCollection

Author: Chad Sikorra ([email protected])
Inheritance: implements IteratorAggregate
Datei anzeigen Open project: ldaptools/ldaptools Class Usage Examples

Protected Properties

Property Type Description
$aliases An array mapping of alias names to schema objects.
$operators Contains the various Operator objects grouped by their type.
$schema Contains the LdapObjectSchema objects

Public Methods

Method Description
__clone ( ) When an operation collection is cloned, we want to make sure the operator objects are cloned as well.
add ( variadic $operators ) Add an Operator to the collection.
addLdapObjectSchema ( LdapObjectSchema $schema, null | string $alias = null ) Add a LdapObjectSchema for a object type that will be selected for. Optionally specify a specific alias that is used to reference it. If no alias is specified, then it uses the object type name for the schema.
getAliases ( ) : string[] Get the aliases in the form of ['alias' => LdapObjectSchema]
getAndOperators ( ) : bAnd[] Get all the 'bAnd' Operators.
getComparisonOperators ( ) : Comparison[] Get all the 'Comparison' Operators.
getIterator ( ) : ArrayIterator Allows this object to be iterated over.
getMatchingRuleOperators ( ) : MatchingRule[] Get all the 'MatchingRule' Operators.
getNotOperators ( ) : bNot[] Get all the 'bNot' Operators.
getOrOperators ( ) : bOr[] Get all the 'bOr' Operators.
getWildcardOperators ( ) : Wildcard[] Get all the 'Wildcard' Operators.
toArray ( ) : BaseOperator[] Get all the Operators sorted into a single array.
toLdapFilter ( string | null $alias = null ) : string Get the LDAP filter string representation of all the operators in the collection.

Protected Methods

Method Description
getLdapFilter ( $alias )
getLdapFilterForAliases ( ) : string Constructs a filter for multiple aliases that would return the requested LDAP objects in a single query.
sortOperatorsToArray ( ) : BaseOperator[] Merges all the Operators into one large array in a specific order. Before doing so, it will apply any schemas that exist.

Method Details

__clone() public method

When an operation collection is cloned, we want to make sure the operator objects are cloned as well.
public __clone ( )

add() public method

Add an Operator to the collection.
public add ( variadic $operators )
$operators variadic

addLdapObjectSchema() public method

Add a LdapObjectSchema for a object type that will be selected for. Optionally specify a specific alias that is used to reference it. If no alias is specified, then it uses the object type name for the schema.
public addLdapObjectSchema ( LdapObjectSchema $schema, null | string $alias = null )
$schema LdapTools\Schema\LdapObjectSchema
$alias null | string

getAliases() public method

Get the aliases in the form of ['alias' => LdapObjectSchema]
public getAliases ( ) : string[]
return string[]

getAndOperators() public method

Get all the 'bAnd' Operators.
public getAndOperators ( ) : bAnd[]
return LdapTools\Query\Operator\bAnd[]

getComparisonOperators() public method

Get all the 'Comparison' Operators.
public getComparisonOperators ( ) : Comparison[]
return LdapTools\Query\Operator\Comparison[]

getIterator() public method

Allows this object to be iterated over.

getLdapFilter() protected method

protected getLdapFilter ( $alias )

getLdapFilterForAliases() protected method

Constructs a filter for multiple aliases that would return the requested LDAP objects in a single query.
protected getLdapFilterForAliases ( ) : string
return string

getMatchingRuleOperators() public method

Get all the 'MatchingRule' Operators.
public getMatchingRuleOperators ( ) : MatchingRule[]
return LdapTools\Query\Operator\MatchingRule[]

getNotOperators() public method

Get all the 'bNot' Operators.
public getNotOperators ( ) : bNot[]
return LdapTools\Query\Operator\bNot[]

getOrOperators() public method

Get all the 'bOr' Operators.
public getOrOperators ( ) : bOr[]
return LdapTools\Query\Operator\bOr[]

getWildcardOperators() public method

Get all the 'Wildcard' Operators.
public getWildcardOperators ( ) : Wildcard[]
return LdapTools\Query\Operator\Wildcard[]

sortOperatorsToArray() protected method

Merges all the Operators into one large array in a specific order. Before doing so, it will apply any schemas that exist.
protected sortOperatorsToArray ( ) : BaseOperator[]
return LdapTools\Query\Operator\BaseOperator[]

toArray() public method

Get all the Operators sorted into a single array.
public toArray ( ) : BaseOperator[]
return LdapTools\Query\Operator\BaseOperator[]

toLdapFilter() public method

Get the LDAP filter string representation of all the operators in the collection.
public toLdapFilter ( string | null $alias = null ) : string
$alias string | null The alias to narrow the filter to.
return string

Property Details

$aliases protected_oe property

An array mapping of alias names to schema objects.
protected $aliases

$operators protected_oe property

Contains the various Operator objects grouped by their type.
protected $operators

$schema protected_oe property

Contains the LdapObjectSchema objects
protected $schema