LdapTools\Operation\QueryOperation::setUsePaging PHP Method

setUsePaging() public method

Set whether or not paging should be used for the query operation.
public setUsePaging ( boolean $paging )
$paging boolean
    public function setUsePaging($paging)
    {
        $this->properties['usePaging'] = $paging;
        return $this;
    }

Usage Example

 function it_should_NOT_enable_paging_when_executing_an_operation_that_disables_paging($pager)
 {
     $operation = new QueryOperation('(sAMAccountName=foo)', ['cn']);
     $operation->setUsePaging(false)->setBaseDn('example.local');
     $pager->setIsEnabled(false)->shouldBeCalled();
     $pager->start(null, 0)->shouldBeCalled();
     $pager->next()->shouldBeCalled();
     // Cannot simulate this without a connection. But the above control logic will be validated anyway.
     $this->shouldThrow('\\LdapTools\\Exception\\LdapConnectionException')->duringExecute($operation);
     $operation = new QueryOperation('(sAMAccountName=foo)', ['cn']);
     $operation->setScope(QueryOperation::SCOPE['BASE'])->setUsePaging(true)->setBaseDn('example.local');
     // Cannot simulate this without a connection. But the above control logic will be validated anyway.
     $this->shouldThrow('\\LdapTools\\Exception\\LdapConnectionException')->duringExecute($operation);
 }
All Usage Examples Of LdapTools\Operation\QueryOperation::setUsePaging