LdapTools\Schema\LdapObjectSchema::setScope PHP Method

setScope() public method

Set the scope of the search for queries using this type.
public setScope ( string | null $scope )
$scope string | null
    public function setScope($scope)
    {
        $this->scope = $scope;
        return $this;
    }

Usage Example

 function it_should_set_the_scope_based_off_the_schema($connection)
 {
     $operation = new QueryOperation('(foo=bar)');
     $this->setLdapObjectSchema($this->schema);
     $this->setLdapConnection($connection);
     $this->hydrateToLdap($operation)->getScope()->shouldBeEqualTo('subtree');
     $this->schema->setScope(QueryOperation::SCOPE['ONELEVEL']);
     $this->hydrateToLdap($operation)->getScope()->shouldBeEqualTo('onelevel');
 }