LdapTools\Schema\LdapObjectSchema::setControls PHP Method

setControls() public method

Set the LDAP controls needed when querying for this operation.
public setControls ( variadic $controls )
$controls variadic
    public function setControls(LdapControl ...$controls)
    {
        $this->controls = $controls;
    }

Usage Example

 function it_should_add_controls_on_an_operation_going_to_ldap($connection)
 {
     $operation = new QueryOperation('(foo=bar');
     $this->setLdapObjectSchema($this->schema);
     $this->setLdapConnection($connection);
     $this->hydrateToLdap($operation)->getControls()->shouldBeEqualTo([]);
     $control = new LdapControl('foo');
     $this->schema->setControls($control);
     $this->hydrateToLdap($operation)->getControls()->shouldBeEqualTo([$control]);
 }