Ldap/Attribute.php
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 [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
-
New BSD License
- Package
- Zend_Ldap
- Version
- $Id: Attribute.php 24593 2012-01-05 20:35:02Z matthew $
Package: Zend\LdapZend_Ldap_Attribute is a collection of LDAP attribute related functions.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
-
New BSD License
Constants


PASSWORD_HASH_MD5
= 'md5'


PASSWORD_HASH_SMD5
= 'smd5'


PASSWORD_HASH_SHA
= 'sha'


PASSWORD_HASH_SSHA
= 'ssha'


PASSWORD_UNICODEPWD
= 'unicodePwd'
Methods



attributeHasValue(array $data, string $attribName, mixed | array $value) : boolean
staticChecks if the given value(s) exist in the attribute
Parameters
Name |
Type |
Description |
$data |
array |
|
$attribName |
string |
|
$value |
mixed | array |
|
Returns



convertFromLdapDateTimeValue(string $value) : integer | null
staticConverts LDAP date/time representation into a timestamp
Parameters
Name |
Type |
Description |
$value |
string |
|
Returns
Type |
Description |
integer | null |
- null if the value cannot be converted. |



convertFromLdapValue(string $value) : mixed
staticConverts an LDAP value into its PHP data type
Parameters
Name |
Type |
Description |
$value |
string |
|
Returns
Details
- Deprected
- use Zend_Ldap_Converter instead



convertToLdapDateTimeValue(integer $value, boolean $utc = false) : string | null
staticConverts a timestamp into its LDAP date/time representation
Parameters
Name |
Type |
Description |
$value |
integer |
|
$utc |
boolean |
|
Returns
Type |
Description |
string | null |
- null if the value cannot be converted. |



convertToLdapValue(mixed $value) : string | null
staticConverts a PHP data type into its LDAP representation
Parameters
Name |
Type |
Description |
$value |
mixed |
|
Returns
Type |
Description |
string | null |
- null if the PHP data type cannot be converted. |
Details
- Deprected
- use Zend_Ldap_Converter instead



createPassword(string $password, string $hashType = self::PASSWORD_HASH_MD5) : string
staticCreates a LDAP password.
Parameters
Name |
Type |
Description |
$password |
string |
|
$hashType |
string |
|
Returns



getAttribute(array $data, string $attribName, integer $index = null) : array | mixed
staticGets a LDAP attribute.
Parameters
Name |
Type |
Description |
$data |
array |
|
$attribName |
string |
|
$index |
integer |
|
Returns
Type |
Description |
array | mixed |
|



getDateTimeAttribute(array $data, string $attribName, integer $index = null) : array | integer
staticGets a LDAP date/time attribute.
Parameters
Name |
Type |
Description |
$data |
array |
|
$attribName |
string |
|
$index |
integer |
|
Returns
Type |
Description |
array | integer |
|



removeDuplicatesFromAttribute(array $data, string $attribName) : void
staticRemoves duplicate values from a LDAP attribute
Parameters
Name |
Type |
Description |
$data |
array |
|
$attribName |
string |
|



removeFromAttribute(array $data, string $attribName, mixed | array $value) : void
staticRemove given values from a LDAP attribute
Parameters
Name |
Type |
Description |
$data |
array |
|
$attribName |
string |
|
$value |
mixed | array |
|



setAttribute(array $data, string $attribName, \scalar | array | \Traversable $value, boolean $append = false) : void
staticSets a LDAP attribute.
Parameters
Name |
Type |
Description |
$data |
array |
|
$attribName |
string |
|
$value |
\scalar | array | \Traversable |
|
$append |
boolean |
|



setDateTimeAttribute(array $data, string $attribName, integer | array | \Traversable $value, boolean $utc = false, boolean $append = false) : null
staticSets a LDAP date/time attribute.
Parameters
Name |
Type |
Description |
$data |
array |
|
$attribName |
string |
|
$value |
integer | array | \Traversable |
|
$utc |
boolean |
|
$append |
boolean |
|
Returns



setPassword(array $data, string $password, string $hashType = self::PASSWORD_HASH_MD5, string | null $attribName = null) : null
staticSets a LDAP password.
Parameters
Name |
Type |
Description |
$data |
array |
|
$password |
string |
|
$hashType |
string |
|
$attribName |
string | null |
|
Returns