LdapTools\Resolver\AttributeNameResolver::setMappedNames PHP Method

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
    protected function setMappedNames(array $newEntry, $attribute, $value)
    {
        // Get all names mapped to this LDAP attribute name...
        if (!$this->schema->hasNamesMappedToAttribute($attribute)) {
            return $newEntry;
        }
        $mappedNames = $this->schema->getNamesMappedToAttribute($attribute);
        foreach ($mappedNames as $mappedName) {
            // Any names specifically selected for should be in the result array...
            if ($this->selectedButNotPartOfEntry($mappedName, $newEntry)) {
                $newEntry[MBString::array_search_get_value($mappedName, $this->selectedAttributes)] = $value;
            }
        }
        return $newEntry;
    }