LdapTools\Hydrator\HydrateQueryTrait::getSelectedQueryAttributes PHP Method

getSelectedQueryAttributes() protected method

Determine what attributes should be selected. This helps account for all attributes being selected both within and out of the context of a schema.
protected getSelectedQueryAttributes ( array $attributes, LdapObjectSchema $schema = null ) : array
$attributes array
$schema LdapTools\Schema\LdapObjectSchema
return array
    protected function getSelectedQueryAttributes(array $attributes, LdapObjectSchema $schema = null)
    {
        // Interpret a single wildcard as only schema attributes.
        if ($schema && !empty($attributes) && $attributes[0] == '*') {
            $attributes = array_keys($schema->getAttributeMap());
            // Interpret a double wildcard as all LDAP attributes even if they aren't in the schema file.
        } elseif ($schema && !empty($attributes) && $attributes[0] == '**') {
            $attributes = ['*'];
        }
        return $attributes;
    }