Net_LDAP2
[ class tree: Net_LDAP2 ] [ index: Net_LDAP2 ] [ all elements ]

Class: Net_LDAP2_Schema

Source Location: /Net_LDAP2-2.1.0/Net/LDAP2/Schema.php

Class Overview

PEAR
   |
   --Net_LDAP2_Schema

Load an LDAP Schema and provide information


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 54]
Load an LDAP Schema and provide information

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.



[ Top ]


Class Variables

$types = array(
            'attribute'        => 'attributeTypes',
            'ditcontentrule'   => 'dITContentRules',
            'ditstructurerule' => 'dITStructureRules',
            'matchingrule'     => 'matchingRules',
            'matchingruleuse'  => 'matchingRuleUse',
            'nameform'         => 'nameForms',
            'objectclass'      => 'objectClasses',
            'syntax'           => 'ldapSyntaxes'
        )

[line 62]

Map of entry types to ldap attributes of subschema entry
  • Access: public

Type:   array


[ Top ]

$_attributeTypes = array()

[line 79]

Array of entries belonging to this type
  • Access: protected

Type:   array


[ Top ]

$_dITContentRules = array()

[line 84]

  • Access: protected

Type:   mixed


[ Top ]

$_dITStructureRules = array()

[line 85]

  • Access: protected

Type:   mixed


[ Top ]

$_initialized =  false

[line 104]

Tells if the schema is initialized

Type:   boolean


[ Top ]

$_ldapSyntaxes = array()

[line 82]

  • Access: protected

Type:   mixed


[ Top ]

$_matchingRules = array()

[line 80]

  • Access: protected

Type:   mixed


[ Top ]

$_matchingRuleUse = array()

[line 81]

  • Access: protected

Type:   mixed


[ Top ]

$_nameForms = array()

[line 86]

  • Access: protected

Type:   mixed


[ Top ]

$_objectClasses = array()

[line 83]

  • Access: protected

Type:   mixed


[ Top ]

$_oids = array()

[line 95]

hash of all fetched oids
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 112]

Net_LDAP2_Schema __construct( )

Constructor of the class
  • Access: protected

[ Top ]

attributeExists   [line 539]

boolean attributeExists( string $attribute)

See if an attribute is defined in the schema
  • Access: public

Parameters:

string   $attribute     Name or OID of the attribute

[ Top ]

checkAttribute   [line 606]

boolean checkAttribute( string $attribute, array $ocls)

See if an attribute is available in a set of objectClasses
  • Return: TRUE, if the attribute is defined for at least one of the OCLs
  • Access: public

Parameters:

string   $attribute     Attribute name or OID
array   $ocls     Names of OCLs to check for

[ Top ]

exists   [line 523]

boolean exists( string $type, string $name)

See if an schema element exists
  • Access: public

Parameters:

string   $type     Type of name, see get()
string   $name     Name or OID

[ Top ]

fetch   [line 126]

Net_LDAP2_Schema|NET_LDAP2_Error fetch( Net_LDAP2 $ldap, [string $dn = null])

Fetch the Schema from an LDAP connection
  • Access: public

Parameters:

Net_LDAP2   $ldap     LDAP connection
string   $dn     (optional) Subschema entry dn

[ Top ]

get   [line 224]

mixed &get( string $type, string $name)

Return a specific entry
  • Return: Entry or Net_LDAP2_Error
  • Access: public

Parameters:

string   $type     Type of name
string   $name     Name or OID to fetch

[ Top ]

getAll   [line 199]

array|Net_LDAP2_Error &getAll( string $type)

Return a hash of entries for the given type

Returns a hash of entry for the givene type. Types may be: objectclasses, attributes, ditcontentrules, ditstructurerules, matchingrules, matchingruleuses, nameforms, syntaxes

  • Return: Array or Net_LDAP2_Error
  • Access: public

Parameters:

string   $type     Type to fetch

[ Top ]

getAssignedOCLs   [line 565]

array|Net_LDAP2_Error getAssignedOCLs( string $attribute)

See to which ObjectClasses an attribute is assigned

The objectclasses are sorted into the keys 'may' and 'must'.

  • Return: Associative array with OCL names or Error
  • Access: public

Parameters:

string   $attribute     Name or OID of the attribute

[ Top ]

isBinary   [line 479]

boolean isBinary( string $attribute)

Returns wether a attribute syntax is binary or not

This method gets used by Net_LDAP2_Entry to decide which PHP function needs to be used to fetch the value in the proper format (e.g. binary or string)

  • Access: public

Parameters:

string   $attribute     The name of the attribute (eg.: 'sn')

[ Top ]

may   [line 257]

array|Net_LDAP2_Error may( string $oc)

Fetches attributes that MAY be present in the given objectclass
  • Return: Array with attributes or Net_LDAP2_Error
  • Access: public

Parameters:

string   $oc     Name or OID of objectclass

[ Top ]

must   [line 270]

array|Net_LDAP2_Error must( string $oc)

Fetches attributes that MUST be present in the given objectclass
  • Return: Array with attributes or Net_LDAP2_Error
  • Access: public

Parameters:

string   $oc     Name or OID of objectclass

[ Top ]

objectClassExists   [line 550]

boolean objectClassExists( string $ocl)

See if an objectClass is defined in the schema
  • Access: public

Parameters:

string   $ocl     Name or OID of the objectClass

[ Top ]

parse   [line 323]

void parse( Net_LDAP2_Entry &$entry)

Parses the schema of the given Subschema entry
  • Access: public

Parameters:

Net_LDAP2_Entry   &$entry     Subschema entry

[ Top ]

superclass   [line 306]

array|Net_LDAP2_Error superclass( string $oc)

Returns the name(s) of the immediate superclass(es)
  • Return: Array of names or Net_LDAP2_Error
  • Access: public

Parameters:

string   $oc     Name or OID of objectclass

[ Top ]

_getAttr   [line 284]

array|Net_LDAP2_Error _getAttr( string $oc, string $attr)

Fetches the given attribute from the given objectclass
  • Return: The attribute or Net_LDAP2_Error
  • Access: protected

Parameters:

string   $oc     Name or OID of objectclass
string   $attr     Name of attribute to fetch

[ Top ]

_parse_entry   [line 368]

array|false &_parse_entry( string $value)

Parses an attribute value into a schema entry
  • Return: Schema entry array or false
  • Access: protected

Parameters:

string   $value     Attribute value

[ Top ]

_tokenize   [line 441]

array _tokenize( string $value)

Tokenizes the given value into an array of tokens
  • Return: Array of tokens
  • Access: protected

Parameters:

string   $value     String to parse

[ Top ]


Documentation generated on Mon, 09 Dec 2013 10:30:08 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.