Zend_Ldap_Converter is a collection of useful LDAP related conversion functions.
category | Zend |
---|---|
package | Zend_Ldap |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
ascToHex32(string $string) : string
see | from Benedikt Hallinger |
---|---|
link | http://pear.php.net/package/Net_LDAP2 |
author | Benedikt Hallinger |
string
String to convert
string
fromLdap(string $value, $type= self::STANDARD
, boolean $dateTimeAsUtc= true
) : mixed
By setting the $type-parameter the conversion of a certain type can be forced .
string
The value to convert
boolean
Return DateTime values in UTC timezone
\Zend_Ldap_Converter_Exception |
---|
mixed
fromLdapBoolean(string $value) : boolean
string
The value to convert
\InvalidArgumentException |
---|
boolean
fromLdapDateTime(string $date, boolean $asUtc = true
) : \DateTime
CAVEAT: The DateTime-Object returned will alwasy be set to UTC-Timezone.
string
The generalized-Time
boolean
Return the DateTime with UTC timezone
\InvalidArgumentException |
if a non-parseable-format is given |
---|
\DateTime
fromLdapUnserialize(string $value) : mixed
string
The value to convert
\UnexpectedValueException |
---|
mixed
hex32ToAsc(string $string) : string
see | from Benedikt Hallinger |
---|---|
link | http://pear.php.net/package/Net_LDAP2 |
author | Benedikt Hallinger |
string
String to convert
string
toLdap(mixed $value, $type = self::STANDARD
) : string
By setting the $type-parameter the conversion of a certain type can be forced
todo | write more tests |
---|
mixed
The value to convert
\Zend_Ldap_Converter_Exception |
---|
string
toLdapBoolean(boolean|integer|string $value) : string
This converts a boolean value of TRUE, an integer-value of 1 and a case-insensitive string 'true' to an LDAP-compatible 'TRUE'. All other other values are converted to an LDAP-compatible 'FALSE'.
boolean
integer
string
The boolean value to encode
string
toLdapDateTime(integer|string|\DateTimt|\Zend_Date $date, boolean $asUtc = true
) : string
The date-entity $date can be either a timestamp, a DateTime Object, a string that is parseable by strtotime() or a Zend_Date Object.
integer
string
\DateTimt
\Zend_Date
The date-entity
boolean
Whether to return the LDAP-compatible date-string as UTC or as local value
\InvalidArgumentException |
---|
string
toLdapSerialize(mixed $value) : string
mixed
The value to serialize
string
_charHex32ToAsc(array $matches) : string
Used as a callback in @see hex32ToAsc()
array
string
BOOLEAN = 1
GENERALIZED_TIME = 2
STANDARD = 0