LdapTools\Query\LdapQueryBuilder::getSchemaFromType PHP Method

getSchemaFromType() protected method

protected getSchemaFromType ( string | LdapObjectSchema $type ) : LdapObjectSchema
$type string | LdapTools\Schema\LdapObjectSchema
return LdapTools\Schema\LdapObjectSchema
    protected function getSchemaFromType($type)
    {
        if (is_string($type) && !$this->schemaFactory) {
            throw new LogicException('To build a filter with schema types you must pass a SchemaFactory to the constructor');
        } elseif (is_string($type)) {
            $type = $this->schemaFactory->get($this->connection->getConfig()->getSchemaName(), $type);
        } elseif (!$type instanceof LdapObjectSchema) {
            throw new InvalidArgumentException('You must either pass the schema object type as a string to this method, or pass the schema types ' . 'LdapObjectSchema to this method.');
        }
        return $type;
    }