Package Home

Zend Framework 2 Documentation (Manual)

PHK Home

File: /_sources/modules/zend.ldap.api.ldap.attribute.txt

Size:13843
Storage flags:no_autoload,compress/gzip (9%)

:orphan:

.. _zend.ldap.api.reference.zend-ldap-attribute:

Zend\\Ldap\\Attribute
=====================

``Zend\Ldap\Attribute`` is a helper class providing only static methods to manipulate arrays suitable to the
structure used in ``Zend\Ldap\Ldap`` data modification methods and to the data format required by the *LDAP*
server. *PHP* data types are converted using ``Zend\Ldap\Converter\Converter`` methods.

.. _zend.ldap.api.reference.zend-ldap-attribute.table:

.. table:: Zend\\Ldap\\Attribute API

   +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   |Method                                                                                                          |Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
   +================================================================================================================+====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================+
   |void setAttribute(array &$data, string $attribName, mixed $value, boolean $append)                              |Sets the attribute $attribName in $data to the value $value. If $append is TRUE (FALSE by default) $value will be appended to the attribute. $value can be a scalar value or an array of scalar values. Conversion will take place.                                                                                                                                                                                                                                                                                                 |
   +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   |array|mixed getAttribute(array $data, string $attribName, integer|null $index)                                  |Returns the attribute $attribName from $data. If $index is NULL (default) an array will be returned containing all the values for the given attribute. An empty array will be returned if the attribute does not exist in the given array. If an integer index is specified the corresponding value at the given index will be returned. If the index is out of bounds, NULL will be returned. Conversion will take place.                                                                                                          |
   +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   |boolean attributeHasValue(array &$data, string $attribName, mixed|array $value)                                 |Checks if the attribute $attribName in $data has the value(s) given in $value. The method returns TRUE only if all values in $value are present in the attribute. Comparison is done strictly (respecting the data type).                                                                                                                                                                                                                                                                                                           |
   +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   |void removeDuplicatesFromAttribute(array &$data, string $attribName)                                            |Removes all duplicates from the attribute $attribName in $data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   |void removeFromAttribute(array &$data, string $attribName, mixed|array $value)                                  |Removes the value(s) given in $value from the attribute $attribName in $data.                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   |void setPassword(array &$data, string $password, string $hashType, string $attribName)                          |Sets a LDAP password for the attribute $attribName in $data. $attribName defaults to 'userPassword' which is the standard password attribute. The password hash can be specified with $hashType. The default value here is Zend\\Ldap\\Attribute::PASSWORD_HASH_MD5 with Zend\\Ldap\\Attribute::PASSWORD_HASH_SHA as the other possibility.                                                                                                                                                                                         |
   +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   |string createPassword(string $password, string $hashType)                                                       |Creates a LDAP password. The password hash can be specified with $hashType. The default value here is Zend\\Ldap\\Attribute::PASSWORD_HASH_MD5 with Zend\\Ldap\\Attribute::PASSWORD_HASH_SHA as the other possibility.                                                                                                                                                                                                                                                                                                              |
   +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   |void setDateTimeAttribute(array &$data, string $attribName, integer|array $value, boolean $utc, boolean $append)|Sets the attribute $attribName in $data to the date/time value $value. if $append is TRUE (FALSE by default) $value will be appended to the attribute. $value can be an integer value or an array of integers. Date-time-conversion according to Zend\\Ldap\\Converter\\Converter::toLdapDateTime() will take place.                                                                                                                                                                                                                |
   +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   |array|integer getDateTimeAttribute(array $data, string $attribName, integer|null $index)                        |Returns the date/time attribute $attribName from $data. If $index is NULL (default) an array will be returned containing all the date/time values for the given attribute. An empty array will be returned if the attribute does not exist in the given array. If an integer index is specified the corresponding date/time value at the given index will be returned. If the index is out of bounds, NULL will be returned. Date-time-conversion according to Zend\\Ldap\\Converter\\Converter::fromLdapDateTime() will take place.|
   +----------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+



For more information about the PHK package format: http://phk.tekwire.net