Class Zend_Ldap_Dn

Description

Implements interfaces:

  • ArrayAccess (internal interface)

Zend_Ldap_Dn provides an API for DN manipulation

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Ldap/Dn.php (line 30)


	
			
Class Constant Summary
Variable Summary
 static string $_defaultCaseFold
 string $_caseFold
 array $_dn
Method Summary
 static boolean checkDn (string $dn, [ &$keys = null], [ &$vals = null], [string $caseFold = self::ATTR_CASEFOLD_NONE], array $keys, array $vals)
 static array escapeValue ([string|array $values = array()])
 static array explodeDn (string $dn, [ &$keys = null], [ &$vals = null], [string $caseFold = self::ATTR_CASEFOLD_NONE], array $keys, array $vals)
 static Zend_Ldap_Dn factory (string|array $dn, [string|null $caseFold = null])
 static Zend_Ldap_Dn fromArray ( $dn, [string|null $caseFold = null])
 static Zend_Ldap_Dn fromString (string $dn, [string|null $caseFold = null])
 static string implodeDn ( $dnArray, [string $caseFold = null], [string $separator = ','])
 static string implodeRdn ( $part, [string $caseFold = null], array $attribute)
 static boolean isChildOf (string|Zend_Ldap_Dn $childDn, string|Zend_Ldap_Dn $parentDn)
 static void setDefaultCaseFold (string $caseFold)
 static array unescapeValue ([string|array $values = array()])
 static boolean _assertRdn ( $value)
 static array _caseFoldDn ( $dn, string $caseFold)
 static array _caseFoldRdn ( $part, string $caseFold)
 static string _sanitizeCaseFold (string $caseFold,  $default)
 Zend_Ldap_Dn __construct ( $dn, string|null $caseFold)
 Zend_Ldap_Dn append ( $value)
 array get (int $index, [int $length = 1], [string $caseFold = null])
 Zend_Ldap_Dn getParentDn ([int $levelUp = 1])
 array getRdn ([string $caseFold = null])
 string getRdnString ([string $caseFold = null])
 Zend_Ldap_Dn insert (int $index,  $value)
 boolean offsetExists (int $offset)
 array offsetGet (int $offset)
 void offsetSet (int $offset, array $value)
 void offsetUnset (int $offset)
 Zend_Ldap_Dn prepend ( $value)
 Zend_Ldap_Dn remove (int $index, [int $length = 1])
 Zend_Ldap_Dn set (int $index,  $value)
 void setCaseFold (string|null $caseFold)
 array toArray ([string $caseFold = null])
 string toString ([string $caseFold = null])
 boolean _assertIndex (mixed $index)
 string __toString ()
Variables
static string $_defaultCaseFold = self::ATTR_CASEFOLD_NONE (line 41)

The default case fold to use

  • access: protected
string $_caseFold (line 48)

The case fold used for this instance

  • access: protected
array $_dn (line 55)

The DN data

  • access: protected
Methods
static checkDn (line 625)
  • return: True if the DN was successfully parsed or false if the string is not a valid DN.
  • access: public
static boolean checkDn (string $dn, [ &$keys = null], [ &$vals = null], [string $caseFold = self::ATTR_CASEFOLD_NONE], array $keys, array $vals)
  • string $dn: The DN to parse
  • array $keys: An optional array to receive DN keys (e.g. CN, OU, DC, ...)
  • array $vals: An optional array to receive DN values
  • string $caseFold
  • array &$keys
  • array &$vals
static escapeValue (line 509)

Escapes a DN value according to RFC 2253

Escapes the given VALUES according to RFC 2253 so that they can be safely used in LDAP DNs. The characters ",", "+", """, "\", "<", ">", ";", "#", " = " with a special meaning in RFC 2252 are preceeded by ba backslash. Control characters with an ASCII code < 32 are represented as \hexpair. Finally all leading and trailing spaces are converted to sequences of \20.

static array escapeValue ([string|array $values = array()])
  • string|array $values: An array containing the DN values that should be escaped
static explodeDn (line 587)

Creates an array containing all parts of the given DN.

Array will be of type array( array("cn" => "name1", "uid" => "user"), array("cn" => "name2"), array("dc" => "example"), array("dc" => "org") ) for a DN of cn=name1+uid=user,cn=name2,dc=example,dc=org.

  • throws: Zend_Ldap_Exception
  • access: public
static array explodeDn (string $dn, [ &$keys = null], [ &$vals = null], [string $caseFold = self::ATTR_CASEFOLD_NONE], array $keys, array $vals)
  • string $dn
  • array $keys: An optional array to receive DN keys (e.g. CN, OU, DC, ...)
  • array $vals: An optional array to receive DN values
  • string $caseFold
  • array &$keys
  • array &$vals
static factory (line 65)

Creates a DN from an array or a string

  • throws: Zend_Ldap_Exception
  • access: public
static Zend_Ldap_Dn factory (string|array $dn, [string|null $caseFold = null])
  • string|array $dn
  • string|null $caseFold
static fromArray (line 107)

Creates a DN from an array

  • throws: Zend_Ldap_Exception
  • access: public
static Zend_Ldap_Dn fromArray ( $dn, [string|null $caseFold = null])
  • array $dn
  • string|null $caseFold
static fromString (line 88)

Creates a DN from a string

  • throws: Zend_Ldap_Exception
  • access: public
static Zend_Ldap_Dn fromString (string $dn, [string|null $caseFold = null])
  • string $dn
  • string|null $caseFold
static implodeDn (line 751)

Implodes an array in the form delivered by explodeDn() to a DN string.

$dnArray must be of type array( array("cn" => "name1", "uid" => "user"), array("cn" => "name2"), array("dc" => "example"), array("dc" => "org") )

  • throws: Zend_Ldap_Exception
  • access: public
static string implodeDn ( $dnArray, [string $caseFold = null], [string $separator = ','])
  • array $dnArray
  • string $caseFold
  • string $separator
static implodeRdn (line 719)

Returns a DN part in the form $attribute = $value

This method supports the creation of multi-valued RDNs $part must contain an even number of elemets.

  • throws: Zend_Ldap_Exception
  • access: public
static string implodeRdn ( $part, [string $caseFold = null], array $attribute)
  • array $attribute
  • string $caseFold
  • array $part
static isChildOf (line 767)

Checks if given $childDn is beneath $parentDn subtree.

static boolean isChildOf (string|Zend_Ldap_Dn $childDn, string|Zend_Ldap_Dn $parentDn)
static setDefaultCaseFold (line 470)

Sets the default case fold

  • access: public
static void setDefaultCaseFold (string $caseFold)
  • string $caseFold
static unescapeValue (line 551)

Undoes the conversion done by escapeValue().

Any escape sequence starting with a baskslash - hexpair or special character - will be transformed back to the corresponding character.

static array unescapeValue ([string|array $values = array()])
  • string|array $values: Array of DN Values
static _assertRdn (line 307)

Assert if value is in a correct RDN format

  • throws: Zend_Ldap_Exception
  • access: protected
static boolean _assertRdn ( $value)
  • array $value
static _caseFoldDn (line 395)

Do a case folding on a DN ort part of it

  • access: protected
static array _caseFoldDn ( $dn, string $caseFold)
  • array $dn
  • string $caseFold
static _caseFoldRdn (line 375)

Do a case folding on a RDN

  • access: protected
static array _caseFoldRdn ( $part, string $caseFold)
  • array $part
  • string $caseFold
static _sanitizeCaseFold (line 481)

Sanitizes the case fold

  • access: protected
static string _sanitizeCaseFold (string $caseFold,  $default)
  • string $caseFold
  • $default
Constructor __construct (line 118)

Constructor

  • access: protected
Zend_Ldap_Dn __construct ( $dn, string|null $caseFold)
  • array $dn
  • string|null $caseFold
append (line 236)

Append a DN part

  • return: Provides a fluent interface
  • access: public
Zend_Ldap_Dn append ( $value)
  • array $value
get (line 179)

Get a DN part

  • throws: Zend_Ldap_Exception if index is illegal
  • access: public
array get (int $index, [int $length = 1], [string $caseFold = null])
  • int $index
  • int $length
  • string $caseFold
getParentDn (line 156)

Get the parent DN $levelUp levels up the tree

  • access: public
Zend_Ldap_Dn getParentDn ([int $levelUp = 1])
  • int $levelUp
getRdn (line 131)

Gets the RDN of the current DN

  • throws: Zend_Ldap_Exception if DN has no RDN (empty array)
  • access: public
array getRdn ([string $caseFold = null])
  • string $caseFold
getRdnString (line 144)

Gets the RDN of the current DN as a string

  • throws: Zend_Ldap_Exception if DN has no RDN (empty array)
  • access: public
string getRdnString ([string $caseFold = null])
  • string $caseFold
insert (line 264)

Insert a DN part

  • return: Provides a fluent interface
  • throws: Zend_Ldap_Exception if index is illegal
  • access: public
Zend_Ldap_Dn insert (int $index,  $value)
  • int $index
  • array $value
offsetExists (line 420)

Required by the ArrayAccess implementation

  • access: public
boolean offsetExists (int $offset)
  • int $offset

Implementation of:
ArrayAccess::offsetExists
offsetGet (line 437)

Proxy to {@see get()} Required by the ArrayAccess implementation

  • access: public
array offsetGet (int $offset)
  • int $offset

Implementation of:
ArrayAccess::offsetGet
offsetSet (line 449)

Proxy to {@see set()} Required by the ArrayAccess implementation

  • access: public
void offsetSet (int $offset, array $value)
  • int $offset
  • array $value

Implementation of:
ArrayAccess::offsetSet
offsetUnset (line 460)

Proxy to {@see remove()} Required by the ArrayAccess implementation

  • access: public
void offsetUnset (int $offset)
  • int $offset

Implementation of:
ArrayAccess::offsetUnset
prepend (line 249)

Prepend a DN part

  • return: Provides a fluent interface
  • access: public
Zend_Ldap_Dn prepend ( $value)
  • array $value
remove (line 219)

Remove a DN part

  • return: Provides a fluent interface
  • throws: Zend_Ldap_Exception if index is illegal
  • access: public
Zend_Ldap_Dn remove (int $index, [int $length = 1])
  • int $index
  • int $length
set (line 203)

Set a DN part

  • return: Provides a fluent interface
  • throws: Zend_Ldap_Exception if index is illegal
  • access: public
Zend_Ldap_Dn set (int $index,  $value)
  • int $index
  • array $value
setCaseFold (line 333)

Sets the case fold

  • access: public
void setCaseFold (string|null $caseFold)
  • string|null $caseFold
toArray (line 357)

Return DN as an array

  • access: public
array toArray ([string $caseFold = null])
  • string $caseFold
toString (line 345)

Return DN as a string

  • throws: Zend_Ldap_Exception
  • access: public
string toString ([string $caseFold = null])
  • string $caseFold
_assertIndex (line 281)

Assert index is correct and usable

  • throws: Zend_Ldap_Exception
  • access: protected
boolean _assertIndex (mixed $index)
  • mixed $index
__toString (line 409)

Cast to string representation {@see toString()}

  • access: public
string __toString ()
Class Constants
ATTR_CASEFOLD_LOWER = 'lower' (line 34)
ATTR_CASEFOLD_NONE = 'none' (line 32)
ATTR_CASEFOLD_UPPER = 'upper' (line 33)

Documentation generated on Mon, 21 Jun 2010 15:17:22 -0400 by phpDocumentor 1.4.3