316. Class

316.1. Zend\Ldap\Converter\Converter

ZendLdapConverter is a collection of useful LDAP related conversion functions.

316.1.1. Methods

316.1.1.1. ascToHex32

ascToHex32()

Converts all ASCII chars < 32 to “HEX”

Parameters:string – String to convert
Return type:string

316.1.1.2. hex32ToAsc

hex32ToAsc()

Converts all Hex expressions (“HEX”) to their original ASCII characters

Parameters:string – String to convert
Return type:string

316.1.1.3. toLdap

toLdap()

Convert any value to an LDAP-compatible value.

By setting the <var>$type</var>-parameter the conversion of a certain type can be forced

Parameters:
  • mixed – The value to convert
  • int – The conversion type to use
Return type:

string|null

Throws :

ExceptionConverterException

316.1.1.4. toLdapDateTime

toLdapDateTime()

Converts a date-entity to an LDAP-compatible date-string

The date-entity <var>$date</var> can be either a timestamp, a DateTime Object, a string that is parseable by strtotime().

Parameters:
  • integer|string|DateTime – The date-entity
  • bool – Whether to return the LDAP-compatible date-string as UTC or as local value
Return type:

string

Throws :

ExceptionInvalidArgumentException

316.1.1.5. toLdapBoolean

toLdapBoolean()

Convert a boolean value to an LDAP-compatible 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’.

Parameters:bool|integer|string – The boolean value to encode
Return type:string

316.1.1.6. toLdapSerialize

toLdapSerialize()

Serialize any value for storage in LDAP

Parameters:mixed – The value to serialize
Return type:string

316.1.1.7. fromLdap

fromLdap()

Convert an LDAP-compatible value to a corresponding PHP-value.

By setting the <var>$type</var>-parameter the conversion of a certain type can be forced.

Parameters:
  • string – The value to convert
  • int – The conversion type to use
  • bool – Return DateTime values in UTC timezone
Return type:

mixed

316.1.1.8. fromLdapDateTime

fromLdapDateTime()

Convert an LDAP-Generalized-Time-entry into a DateTime-Object

CAVEAT: The DateTime-Object returned will always be set to UTC-Timezone.

Parameters:
  • string – The generalized-Time
  • bool – Return the DateTime with UTC timezone
Return type:

DateTime

Throws :

ExceptionInvalidArgumentException if a non-parseable-format is given

316.1.1.9. fromLdapBoolean

fromLdapBoolean()

Convert an LDAP-compatible boolean value into a PHP-compatible one

Parameters:string – The value to convert
Return type:bool
Throws :ExceptionInvalidArgumentException

316.1.1.10. fromLdapUnserialize

fromLdapUnserialize()

Unserialize a serialized value to return the corresponding object

Parameters:string – The value to convert
Return type:mixed
Throws :ExceptionUnexpectedValueException

316.1.2. Constants

316.1.2.1. STANDARD

316.1.2.2. BOOLEAN

316.1.2.3. GENERALIZED_TIME