LdapTools\Schema\LdapObjectSchema::setObjectCategory PHP Method

setObjectCategory() public method

Set the objectCategory that this schema object refers to.
public setObjectCategory ( $objectCategory )
$objectCategory
    public function setObjectCategory($objectCategory)
    {
        $this->objectCategory = $objectCategory;
    }

Usage Example

 function it_should_get_an_operator_filter_for_a_schema_adding_the_objectClass_objectCategory_and_filter_array()
 {
     $schema = new LdapObjectSchema('ad', 'user');
     $schema->setObjectClass(['user']);
     $schema->setObjectCategory('person');
     $this->getOperatorForSchema($schema, [])->toLdapFilter()->shouldBeEqualTo('(&(objectCategory=person)(objectClass=user))');
     $this->getOperatorForSchema($schema, ['starts_with' => ['username', 'admin']])->toLdapFilter()->shouldBeEqualTo('(&(&(objectCategory=person)(objectClass=user))(&(username=admin*)))');
 }