LdapTools\Schema\LdapObjectSchema::setFilter PHP Method

setFilter() public method

Set the operator that will be used as a filter for querying LDAP for this object type.
public setFilter ( BaseOperator $filter )
$filter LdapTools\Query\Operator\BaseOperator
    public function setFilter(BaseOperator $filter)
    {
        $this->filter = $filter;
    }

Usage Example

 function let(LdapConnectionInterface $connection)
 {
     $config = new Configuration();
     $domain = new DomainConfiguration('example.com');
     $domain->setServers(['example'])->setBaseDn('dc=example,dc=com')->setLazyBind(true)->setPageSize(500);
     $connection->getConfig()->willReturn($domain);
     $config->setCacheType('none');
     $parser = SchemaParserFactory::get($config->getSchemaFormat(), $config->getSchemaFolder());
     $cache = CacheFactory::get($config->getCacheType(), []);
     $dispatcher = new SymfonyEventDispatcher();
     $schemaFactory = new LdapObjectSchemaFactory($cache, $parser, $dispatcher);
     $this->fb = new FilterBuilder();
     $this->schema = $schemaFactory;
     $this->objectSchema = $schema = new LdapObjectSchema('ad', 'user');
     $this->objectSchema->setFilter($this->fb->bAnd($this->fb->eq('objectCategory', 'person'), $this->fb->eq('objectClass', 'user')));
     $this->beConstructedWith($connection, $schemaFactory);
 }
All Usage Examples Of LdapTools\Schema\LdapObjectSchema::setFilter