LdapTools\Operation\QueryOperation::setAttributes PHP Method

setAttributes() public method

Set the attributes to be selected for the query operation.
public setAttributes ( array $attributes )
$attributes array
    public function setAttributes(array $attributes)
    {
        $this->properties['attributes'] = $attributes;
        return $this;
    }

Usage Example

Example #1
0
 function it_should_sort_case_sensitive_if_specified($connection)
 {
     $this->setIsCaseSensitiveSort(true)->shouldReturnAnInstanceOf('LdapTools\\Query\\LdapQuery');
     $this->operation->setAttributes(['givenName', 'sn', 'whenCreated']);
     $this->setOrderBy(['givenName' => 'ASC']);
     $entries = $this->sortEntries;
     $entries[1]['givenname'][0] = 'archie';
     $connection->execute(Argument::that(function ($op) {
         return $op->getAttributes() == ['givenName', 'sn', 'whenCreated'];
     }))->willReturn($entries);
     $this->getResult()->shouldHaveFirstValue('givenName', 'archie');
     $this->setOrderBy(['givenName' => 'DESC']);
     $this->getResult()->shouldHaveFirstValue('givenName', 'Archie');
 }
All Usage Examples Of LdapTools\Operation\QueryOperation::setAttributes