PHP Class LdapTools\Resolver\AttributeNameResolver

Author: Chad Sikorra ([email protected])
Datei anzeigen Open project: ldaptools/ldaptools

Protected Properties

Property Type Description
$schema LdapTools\Schema\LdapObjectSchema | null
$selectedAttributes The attribute names in the exact form they were selected for.

Public Methods

Method Description
__construct ( LdapObjectSchema $schema = null )
fromLdap ( array $entry, array $selectedAttributes ) : array Transform the LDAP attribute names into what is expected given the current context (schema or not).
toLdap ( array $entry ) : array Convert values to LDAP.

Protected Methods

Method Description
addDnFromLdapIfNotPresent ( array $newEntry, array $entry ) : array The DN attribute is returned by PHP on all LDAP search operations, regardless of selected attributes, and is used in many functions. So add it to the results even if it wasn't selected for.
getSelectedAttributes ( array $selected, array $entry ) : array Determine what attributes should be selected. This accounts for a query wanting all attributes.
selectedButNotPartOfEntry ( string $attribute, array $entry ) : boolean Check whether the attribute name was selected to be returned but is not yet part of the entry. Adjusts the check to be case insensitive.
setMappedNames ( array $newEntry, string $attribute, array | string $value ) : mixed Set all the names mapped to a single attribute from LDAP. This helps account for multiple mappings used for different purposes.

Method Details

__construct() public method

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

addDnFromLdapIfNotPresent() protected method

The DN attribute is returned by PHP on all LDAP search operations, regardless of selected attributes, and is used in many functions. So add it to the results even if it wasn't selected for.
protected addDnFromLdapIfNotPresent ( array $newEntry, array $entry ) : array
$newEntry array
$entry array
return array

fromLdap() public method

Transform the LDAP attribute names into what is expected given the current context (schema or not).
public fromLdap ( array $entry, array $selectedAttributes ) : array
$entry array The LDAP entry.
$selectedAttributes array The attributes that were selected.
return array

getSelectedAttributes() protected method

Determine what attributes should be selected. This accounts for a query wanting all attributes.
protected getSelectedAttributes ( array $selected, array $entry ) : array
$selected array
$entry array
return array

selectedButNotPartOfEntry() protected method

Check whether the attribute name was selected to be returned but is not yet part of the entry. Adjusts the check to be case insensitive.
protected selectedButNotPartOfEntry ( string $attribute, array $entry ) : boolean
$attribute string
$entry array
return boolean

setMappedNames() protected method

Set all the names mapped to a single attribute from LDAP. This helps account for multiple mappings used for different purposes.
protected setMappedNames ( array $newEntry, string $attribute, array | string $value ) : mixed
$newEntry array
$attribute string
$value array | string
return mixed

toLdap() public method

Convert values to LDAP.
public toLdap ( array $entry ) : array
$entry array The LDAP entry.
return array

Property Details

$schema protected_oe property

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

$selectedAttributes protected_oe property

The attribute names in the exact form they were selected for.
protected $selectedAttributes