PHP Class Horde_Ldap_Schema, horde

This class takes a Subschema entry, parses this information and makes it available in an array. Most of the code has been inspired by perl-ldap( http://perl-ldap.sourceforge.net). You will find portions of their implementation in here. Copyright 2009 Jan Wagner, Benedikt Hallinger Copyright 2010-2016 Horde LLC (http://www.horde.org/)
Author: Jan Wagner ([email protected])
Author: Benedikt Hallinger ([email protected])
Author: Jan Schneider ([email protected])
Exibir arquivo Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$types array Map of entry types to LDAP attributes of subschema entry.

Protected Properties

Property Type Description
$_attributeTypes array Array of entries belonging to this type
$_dITContentRules
$_dITStructureRules
$_initialized boolean Whether the schema is initialized.
$_ldapSyntaxes
$_matchingRuleUse
$_matchingRules
$_nameForms
$_objectClasses
$_oids array Hash of all fetched OIDs.

Public Methods

Method Description
__construct ( Horde_Ldap $ldap, string $dn = null ) Constructor.
get ( string $type, string $name ) : mixed Returns a specific entry.
getAll ( string $type ) : array Returns a hash of entries for the given type.
isBinary ( string $attribute ) : boolean Returns wether a attribute syntax is binary or not.
may ( string $oc, boolean $checksup = false ) : array Fetches attributes that MAY be present in the given objectclass.
must ( string $oc, boolean $checksup = false ) : array Fetches attributes that MUST be present in the given objectclass.
parse ( Horde_Ldap_Entry $entry ) Parses the schema of the given subschema entry.
superclass ( string $oc ) : array Returns the name(s) of the immediate superclass(es).

Protected Methods

Method Description
_getAttr ( string $oc, string $attr ) : array Fetches the given attribute from the given objectclass.
_parse_entry ( string $value ) : array Parses an attribute value into a schema entry.
_tokenize ( string $value ) : array Tokenizes the given value into an array of tokens.

Method Details

__construct() public method

Fetches the Schema from an LDAP connection.
public __construct ( Horde_Ldap $ldap, string $dn = null )
$ldap Horde_Ldap LDAP connection.
$dn string Subschema entry DN.

_getAttr() protected method

Fetches the given attribute from the given objectclass.
protected _getAttr ( string $oc, string $attr ) : array
$oc string Name or OID of objectclass.
$attr string Name of attribute to fetch.
return array The attribute.

_parse_entry() protected method

Parses an attribute value into a schema entry.
protected _parse_entry ( string $value ) : array
$value string Attribute value.
return array Schema entry array.

_tokenize() protected method

Tokenizes the given value into an array of tokens.
protected _tokenize ( string $value ) : array
$value string String to parse.
return array Array of tokens.

get() public method

Returns a specific entry.
public get ( string $type, string $name ) : mixed
$type string Type of name.
$name string Name or OID to fetch.
return mixed

getAll() public method

Types may be: objectclasses, attributes, ditcontentrules, ditstructurerules, matchingrules, matchingruleuses, nameforms, syntaxes.
public getAll ( string $type ) : array
$type string Type to fetch.
return array

isBinary() public method

This method is used by Horde_Ldap_Entry to decide which PHP function needs to be used to fetch the value in the proper format (e.g. binary or string).
public isBinary ( string $attribute ) : boolean
$attribute string The name of the attribute (eg.: 'sn').
return boolean True if the attribute is a binary type.

may() public method

Fetches attributes that MAY be present in the given objectclass.
public may ( string $oc, boolean $checksup = false ) : array
$oc string Name or OID of objectclass.
$checksup boolean Check all superiour objectclasses too?
return array Array with attributes.

must() public method

Fetches attributes that MUST be present in the given objectclass.
public must ( string $oc, boolean $checksup = false ) : array
$oc string Name or OID of objectclass.
$checksup boolean Check all superiour objectclasses too?
return array Array with attributes.

parse() public method

Parses the schema of the given subschema entry.
public parse ( Horde_Ldap_Entry $entry )
$entry Horde_Ldap_Entry Subschema entry.

superclass() public method

Returns the name(s) of the immediate superclass(es).
public superclass ( string $oc ) : array
$oc string Name or OID of objectclass.
return array

Property Details

$_attributeTypes protected_oe property

Array of entries belonging to this type
protected array $_attributeTypes
return array

$_dITContentRules protected_oe property

protected $_dITContentRules

$_dITStructureRules protected_oe property

protected $_dITStructureRules

$_initialized protected_oe property

Whether the schema is initialized.
protected bool $_initialized
return boolean

$_ldapSyntaxes protected_oe property

protected $_ldapSyntaxes

$_matchingRuleUse protected_oe property

protected $_matchingRuleUse

$_matchingRules protected_oe property

protected $_matchingRules

$_nameForms protected_oe property

protected $_nameForms

$_objectClasses protected_oe property

protected $_objectClasses

$_oids protected_oe property

Hash of all fetched OIDs.
protected array $_oids
return array

$types public_oe property

Map of entry types to LDAP attributes of subschema entry.
public array $types
return array