LdapTools\Resolver\AttributeNameResolver::addDnFromLdapIfNotPresent PHP Method

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
    protected function addDnFromLdapIfNotPresent(array $newEntry, array $entry)
    {
        if (!isset($newEntry['dn']) && isset($entry['dn'])) {
            $newEntry['dn'] = $entry['dn'];
        }
        return $newEntry;
    }