PHP Class LdapTools\Hydrator\ArrayHydrator

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

Protected Properties

Property Type Description
$connection LdapTools\Connection\LdapConnectionInterface | null
$orderBy The attributes to order by.
$parameters Default parameter values that have been set.
$schema LdapTools\Schema\LdapObjectSchema
$selectedAttributes The attributes selected for in the query.
$type The operation type that is requesting this hydration process.

Public Methods

Method Description
__construct ( LdapTools\Connection\LdapConnectionInterface $connection = null )
getLdapObjectSchema ( )
getParameters ( ) : array Get the array of additional possible parameters that have been set for the hydrator.
getSelectedAttributes ( )
hydrateAllFromLdap ( array $entries )
hydrateFromLdap ( array $entry )
hydrateToLdap ( $attributes )
setLdapConnection ( LdapTools\Connection\LdapConnectionInterface $connection = null )
setLdapObjectSchema ( LdapObjectSchema $schema = null )
setOperationType ( $type )
setOrderBy ( array $orderBy )
setParameter ( string $name, string $value ) Sets a parameter that can be used within an attribute value.
setSelectedAttributes ( array $attributes )

Protected Methods

Method Description
configureValueResolver ( BaseValueResolver $valueResolver, null | string $dn = null ) Retrieve the AttributeValueResolver instance with the connection and other information set if needed.
convertNamesFromLdap ( array $entry ) : array Replace the LDAP attribute names with the schema names if there is a schema present.
convertNamesToLdap ( array $attributes ) : array Converts attribute names from their schema defined value to the value LDAP needs them in.
convertValuesFromLdap ( array $entry ) : array Replace attribute values with the converted values if the attribute has a converter defined.
convertValuesToLdap ( array | BatchCollection | OperatorCollection $values, string | null $dn = null ) : array | BatchCollection | OperatorCollection Checks for attributes assigned an attribute converter. It will replace the value with the converted value then send back all the attributes.
mergeDefaultAttributes ( array $attributes ) : array Returns all of the attributes to be sent to LDAP after factoring in possible default schema values.
resolveParameters ( array $attributes ) : array Resolves all parameters within an array of attributes.
setAttributeFromLdap ( array $entry, string $attribute, string | array $value ) : array Given a specific attribute and value add it to the newly formed LDAP entry array.
validateAttributesToLdap ( array $attributes ) Checks to make sure all required attributes are present.

Method Details

__construct() public method

public __construct ( LdapTools\Connection\LdapConnectionInterface $connection = null )
$connection LdapTools\Connection\LdapConnectionInterface

configureValueResolver() protected method

Retrieve the AttributeValueResolver instance with the connection and other information set if needed.
protected configureValueResolver ( BaseValueResolver $valueResolver, null | string $dn = null )
$valueResolver LdapTools\Resolver\BaseValueResolver
$dn null | string

convertNamesFromLdap() protected method

Replace the LDAP attribute names with the schema names if there is a schema present.
protected convertNamesFromLdap ( array $entry ) : array
$entry array
return array

convertNamesToLdap() protected method

Converts attribute names from their schema defined value to the value LDAP needs them in.
protected convertNamesToLdap ( array $attributes ) : array
$attributes array
return array

convertValuesFromLdap() protected method

Replace attribute values with the converted values if the attribute has a converter defined.
protected convertValuesFromLdap ( array $entry ) : array
$entry array
return array

convertValuesToLdap() protected method

Checks for attributes assigned an attribute converter. It will replace the value with the converted value then send back all the attributes.
protected convertValuesToLdap ( array | BatchCollection | OperatorCollection $values, string | null $dn = null ) : array | BatchCollection | OperatorCollection
$values array | LdapTools\BatchModify\BatchCollection | LdapTools\Query\OperatorCollection
$dn string | null
return array | LdapTools\BatchModify\BatchCollection | LdapTools\Query\OperatorCollection

getLdapObjectSchema() public method

public getLdapObjectSchema ( )

getParameters() public method

Get the array of additional possible parameters that have been set for the hydrator.
public getParameters ( ) : array
return array

getSelectedAttributes() public method

hydrateAllFromLdap() public method

public hydrateAllFromLdap ( array $entries )
$entries array

hydrateFromLdap() public method

public hydrateFromLdap ( array $entry )
$entry array

hydrateToLdap() public method

public hydrateToLdap ( $attributes )

mergeDefaultAttributes() protected method

Returns all of the attributes to be sent to LDAP after factoring in possible default schema values.
protected mergeDefaultAttributes ( array $attributes ) : array
$attributes array
return array

resolveParameters() protected method

Resolves all parameters within an array of attributes.
protected resolveParameters ( array $attributes ) : array
$attributes array
return array

setAttributeFromLdap() protected method

Given a specific attribute and value add it to the newly formed LDAP entry array.
protected setAttributeFromLdap ( array $entry, string $attribute, string | array $value ) : array
$entry array
$attribute string
$value string | array
return array

setLdapConnection() public method

public setLdapConnection ( LdapTools\Connection\LdapConnectionInterface $connection = null )
$connection LdapTools\Connection\LdapConnectionInterface

setLdapObjectSchema() public method

public setLdapObjectSchema ( LdapObjectSchema $schema = null )
$schema LdapTools\Schema\LdapObjectSchema

setOperationType() public method

public setOperationType ( $type )

setOrderBy() public method

public setOrderBy ( array $orderBy )
$orderBy array

setParameter() public method

Sets a parameter that can be used within an attribute value.
public setParameter ( string $name, string $value )
$name string
$value string

setSelectedAttributes() public method

public setSelectedAttributes ( array $attributes )
$attributes array

validateAttributesToLdap() protected method

Checks to make sure all required attributes are present.
protected validateAttributesToLdap ( array $attributes )
$attributes array

Property Details

$connection protected_oe property

protected LdapConnectionInterface,LdapTools\Connection|null $connection
return LdapTools\Connection\LdapConnectionInterface | null

$orderBy protected_oe property

The attributes to order by.
protected $orderBy

$parameters protected_oe property

Default parameter values that have been set.
protected $parameters

$schema protected_oe property

protected LdapObjectSchema,LdapTools\Schema $schema
return LdapTools\Schema\LdapObjectSchema

$selectedAttributes protected_oe property

The attributes selected for in the query.
protected $selectedAttributes

$type protected_oe property

The operation type that is requesting this hydration process.
protected $type