LdapTools\Schema\LdapObjectSchema::getScope PHP Method

getScope() public method

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

Usage Example

Esempio n. 1
0
 /**
  * Validate that an object schema meets the minimum requirements.
  *
  * @param LdapObjectSchema $schema
  * @throws SchemaParserException
  */
 protected function validateObjectSchema($schema)
 {
     if (empty($schema->getAttributeMap())) {
         throw new SchemaParserException(sprintf('Object type "%s" has no attributes defined.', $schema->getObjectType()));
     } elseif (!(bool) count(array_filter(array_keys($schema->getAttributeMap()), 'is_string'))) {
         throw new SchemaParserException('The attributes for a schema should be an associative array.');
     }
     if ($schema->getScope() && !in_array($schema->getScope(), QueryOperation::SCOPE)) {
         throw new SchemaParserException(sprintf('The scope "%s" is not valid. Valid types are: %s', $schema->getScope(), implode(', ', QueryOperation::SCOPE)));
     }
 }