LdapTools\Schema\LdapObjectSchema::setAttributesToSelect PHP Method

setAttributesToSelect() public method

Set the attributes that will be retrieved by default when using LdapQueryBuilder or a Repository.
public setAttributesToSelect ( array $attributes )
$attributes array
    public function setAttributesToSelect(array $attributes)
    {
        $this->attributesToSelect = $attributes;
    }

Usage Example

 function it_should_pass_operation_options_on_to_the_LdapQuery_class_correctly()
 {
     $this->objectSchema->setAttributesToSelect(['foo', 'bar']);
     $this->select();
     $this->from($this->objectSchema);
     $this->setScopeOneLevel();
     $this->setBaseDn('ou=stuff,dc=foo,dc=bar');
     $this->setPageSize('9001');
     $this->getLdapQuery()->getQueryOperation()->getAttributes()->shouldBeEqualTo([]);
     $this->getLdapQuery()->getQueryOperation()->getBaseDn()->shouldBeEqualTo('ou=stuff,dc=foo,dc=bar');
     $this->getLdapQuery()->getQueryOperation()->getScope()->shouldBeEqualTo(QueryOperation::SCOPE['ONELEVEL']);
     $this->getLdapQuery()->getQueryOperation()->getPageSize()->shouldBeEqualTo('9001');
     $this->getLdapQuery()->getQueryOperation()->getFilter()->toLdapFilter()->shouldBeEqualTo('(&(objectCategory=person)(objectClass=user))');
     $this->select('foo');
     $this->getLdapQuery()->getQueryOperation()->getAttributes()->shouldBeEqualTo(['foo']);
 }
All Usage Examples Of LdapTools\Schema\LdapObjectSchema::setAttributesToSelect