src/LdapTools/Hydrator/HydrateQueryTrait.php
protected function getAttributesToLdap(array $attributes, $translate, LdapObjectSchema $schema = null, $alias = null)
    {
        // First determine if this was some sort of wildcard selection
        $attributes = $this->getSelectedQueryAttributes($attributes, $schema);
        // This will return only the attributes for the current alias, minus the possible alias prefix.
        if ($schema) {
            $attributes = $this->getAttributesForAlias($attributes, $alias);
        }
        // If we still have an empty array here, then fill it with the defaults because nothing was selected specifically.
        if ($schema && empty($attributes)) {
            $attributes = $schema->getAttributesToSelect();
        }
        // At this point we add any orderBy attributes that are not being specifically selected already.
        if (!empty($this->orderBy)) {
            $attributes = $this->mergeOrderByAttributes($attributes, $alias);
        }
        
        if ($schema && $translate) {
            $newAttributes = [];
            foreach ($attributes as $attribute) {
                $newAttributes[] = $schema->getAttributeToLdap($attribute);
            }
            $attributes = $newAttributes;
        }

        return $attributes;
    }
protected function getAttributesToLdap(array $attributes, $translate, LdapObjectSchema $schema = null, $alias = null)
    {
        // First determine if this was some sort of wildcard selection
        $attributes = $this->getSelectedQueryAttributes($attributes, $schema);
        // This will return only the attributes for the current alias, minus the possible alias prefix.
        if ($schema) {
            $attributes = $this->getAttributesForAlias($attributes, $alias);
        }
        // If we still have an empty array here, then fill it with the defaults because nothing was selected specifically.
        if ($schema && empty($attributes)) {
            $attributes = $schema->getAttributesToSelect();
        }
        // At this point we add any orderBy attributes that are not being specifically selected already.
        if (!empty($this->orderBy)) {
            $attributes = $this->mergeOrderByAttributes($attributes, $alias);
        }
        
        if ($schema && $translate) {
            $newAttributes = [];
            foreach ($attributes as $attribute) {
                $newAttributes[] = $schema->getAttributeToLdap($attribute);
            }
            $attributes = $newAttributes;
        }

        return $attributes;
    }
protected function getAttributesToLdap ( array $ attributes , $ translate , LdapObjectSchema $ schema = null , $ alias = null ) { // First determine if this was some sort of wildcard selection $ attributes = $ this -> getSelectedQueryAttributes ( $ attributes , $ schema ) ; // This will return only the attributes for the current alias, minus the possible alias prefix. if ( $ schema ) { $ attributes = $ this -> getAttributesForAlias ( $ attributes , $ alias ) ; } // If we still have an empty array here, then fill it with the defaults because nothing was selected specifically. if ( $ schema && empty ( $ attributes ) ) { $ attributes = $ schema -> getAttributesToSelect ( ) ; } // At this point we add any orderBy attributes that are not being specifically selected already. if ( ! empty ( $ this -> orderBy ) ) { $ attributes = $ this -> mergeOrderByAttributes ( $ attributes , $ alias ) ; } if ( $ schema && $ translate ) { $ newAttributes = [ ] ; foreach ( $ attributes as $ attribute ) { $ newAttributes [ ] = $ schema -> getAttributeToLdap ( $ attribute ) ; } $ attributes = $ newAttributes ; } return $ attributes ; }
Performs the logic needed to determine what attributes were actually selected, or should be selected, when going
to LDAP and whether they should be returned as schema translated names.

@param array $attributes
@param bool
@param LdapObjectSchema|null $schema
@param null|string $alias
@return array
Performs the logic needed to determine what attributes were actually selected or should be selected when going to LDAP and whether they should be returned as schema translated names .