Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Zend_Ldap_Dn provides an API for DN manipulation
ATTR_CASEFOLD_NONE = 'none'
ATTR_CASEFOLD_UPPER = 'upper'
ATTR_CASEFOLD_LOWER = 'lower'
string $_caseFold = ''
The case fold used for this instance
string $_defaultCaseFold = 'self'
The default case fold to use
array $_dn = ''
The DN data
__construct(
array $dn, string|null $caseFold
)
:
Constructor
__toString(
)
:
string
Cast to string representation {@see toString()}
_assertIndex(
mixed $index
)
:
boolean
Assert index is correct and usable
_assertRdn(
array $value
)
:
boolean
Assert if value is in a correct RDN format
_caseFoldDn(
array $dn, string $caseFold
)
:
array
Do a case folding on a DN ort part of it
_caseFoldRdn(
array $part, string $caseFold
)
:
array
Do a case folding on a RDN
_sanitizeCaseFold(
string $caseFold, $default
)
:
string
Sanitizes the case fold
append(
array $value
)
:
Zend_Ldap_Dn
Append a DN part
checkDn(
string $dn, array $keys
=
null, array $vals
=
null, string $caseFold
=
self
)
:
boolean
escapeValue(
string|array $values
=
array
)
:
array
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.
explodeDn(
string $dn, array $keys
=
null, array $vals
=
null, string $caseFold
=
self
)
:
array
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.
factory(
string|array $dn, string|null $caseFold
=
null
)
:
Zend_Ldap_Dn
Creates a DN from an array or a string
fromArray(
array $dn, string|null $caseFold
=
null
)
:
Zend_Ldap_Dn
Creates a DN from an array
fromString(
string $dn, string|null $caseFold
=
null
)
:
Zend_Ldap_Dn
Creates a DN from a string
get(
int $index, int $length
=
1, string $caseFold
=
null
)
:
array
Get a DN part
getParentDn(
int $levelUp
=
1
)
:
Zend_Ldap_Dn
Get the parent DN $levelUp levels up the tree
getRdn(
string $caseFold
=
null
)
:
array
Gets the RDN of the current DN
getRdnString(
string $caseFold
=
null
)
:
string
Gets the RDN of the current DN as a string
implodeDn(
array $dnArray, string $caseFold
=
null, string $separator
=
,
)
:
string
Implodes an array in the form delivered by {@link 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") )
implodeRdn(
$part, string $caseFold
=
null
)
:
string
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.
insert(
int $index, array $value
)
:
Zend_Ldap_Dn
Insert a DN part
isChildOf(
string|Zend_Ldap_Dn $childDn, string|Zend_Ldap_Dn $parentDn
)
:
boolean
Checks if given $childDn is beneath $parentDn subtree.
offsetExists(
int $offset
)
:
boolean
Required by the ArrayAccess implementation
offsetGet(
int $offset
)
:
array
Proxy to {@see get()} Required by the ArrayAccess implementation
offsetSet(
int $offset, array $value
)
:
Proxy to {@see set()} Required by the ArrayAccess implementation
offsetUnset(
int $offset
)
:
Proxy to {@see remove()} Required by the ArrayAccess implementation
prepend(
array $value
)
:
Zend_Ldap_Dn
Prepend a DN part
remove(
int $index, int $length
=
1
)
:
Zend_Ldap_Dn
Remove a DN part
set(
int $index, array $value
)
:
Zend_Ldap_Dn
Set a DN part
setCaseFold(
string|null $caseFold
)
:
Sets the case fold
setDefaultCaseFold(
string $caseFold
)
:
Sets the default case fold
toArray(
string $caseFold
=
null
)
:
array
Return DN as an array
toString(
string $caseFold
=
null
)
:
string
Return DN as a string
unescapeValue(
string|array $values
=
array
)
:
array
Undoes the conversion done by {@link escapeValue()}.
Any escape sequence starting with a baskslash - hexpair or special character - will be transformed back to the corresponding character.