PHP Class Zend_Ldap_Attribute

Mostra file Open project: kimai/kimai Class Usage Examples

Public Methods

Method Description
attributeHasValue ( array &$data, string $attribName, mixed | array $value ) : boolean Checks if the given value(s) exist in the attribute
convertFromLdapDateTimeValue ( string $value ) : integer | null Converts LDAP date/time representation into a timestamp
convertFromLdapValue ( string $value ) : mixed Converts an LDAP value into its PHP data type
convertToLdapDateTimeValue ( integer $value, boolean $utc = false ) : string | null Converts a timestamp into its LDAP date/time representation
convertToLdapValue ( mixed $value ) : string | null Converts a PHP data type into its LDAP representation
createPassword ( string $password, string $hashType = self::PASSWORD_HASH_MD5 ) : string Creates a LDAP password.
getAttribute ( array $data, string $attribName, integer $index = null ) : array | mixed Gets a LDAP attribute.
getDateTimeAttribute ( array $data, string $attribName, integer $index = null ) : array | integer Gets a LDAP date/time attribute.
removeDuplicatesFromAttribute ( array &$data, string $attribName ) : void Removes duplicate values from a LDAP attribute
removeFromAttribute ( array &$data, string $attribName, mixed | array $value ) : void Remove given values from a LDAP attribute
setAttribute ( array &$data, string $attribName, scalar | array | Traversable $value, boolean $append = false ) : void Sets a LDAP attribute.
setDateTimeAttribute ( array &$data, string $attribName, integer | array | Traversable $value, boolean $utc = false, boolean $append = false ) : null Sets a LDAP date/time attribute.
setPassword ( array &$data, string $password, string $hashType = self::PASSWORD_HASH_MD5, string | null $attribName = null ) : null Sets a LDAP password.

Private Methods

Method Description
_valueFromLdap ( string $value ) : mixed
_valueFromLdapDateTime ( string | DateTime $value ) : integer | null
_valueToLdap ( mixed $value ) : string | null
_valueToLdapDateTime ( integer $value, boolean $utc ) : string | null

Method Details

attributeHasValue() public static method

Checks if the given value(s) exist in the attribute
public static attributeHasValue ( array &$data, string $attribName, mixed | array $value ) : boolean
$data array
$attribName string
$value mixed | array
return boolean

convertFromLdapDateTimeValue() public static method

Converts LDAP date/time representation into a timestamp
public static convertFromLdapDateTimeValue ( string $value ) : integer | null
$value string
return integer | null - null if the value cannot be converted.

convertFromLdapValue() public static method

Converts an LDAP value into its PHP data type
public static convertFromLdapValue ( string $value ) : mixed
$value string
return mixed

convertToLdapDateTimeValue() public static method

Converts a timestamp into its LDAP date/time representation
public static convertToLdapDateTimeValue ( integer $value, boolean $utc = false ) : string | null
$value integer
$utc boolean
return string | null - null if the value cannot be converted.

convertToLdapValue() public static method

Converts a PHP data type into its LDAP representation
public static convertToLdapValue ( mixed $value ) : string | null
$value mixed
return string | null - null if the PHP data type cannot be converted.

createPassword() public static method

Creates a LDAP password.
public static createPassword ( string $password, string $hashType = self::PASSWORD_HASH_MD5 ) : string
$password string
$hashType string
return string

getAttribute() public static method

Gets a LDAP attribute.
public static getAttribute ( array $data, string $attribName, integer $index = null ) : array | mixed
$data array
$attribName string
$index integer
return array | mixed

getDateTimeAttribute() public static method

Gets a LDAP date/time attribute.
public static getDateTimeAttribute ( array $data, string $attribName, integer $index = null ) : array | integer
$data array
$attribName string
$index integer
return array | integer

removeDuplicatesFromAttribute() public static method

Removes duplicate values from a LDAP attribute
public static removeDuplicatesFromAttribute ( array &$data, string $attribName ) : void
$data array
$attribName string
return void

removeFromAttribute() public static method

Remove given values from a LDAP attribute
public static removeFromAttribute ( array &$data, string $attribName, mixed | array $value ) : void
$data array
$attribName string
$value mixed | array
return void

setAttribute() public static method

Sets a LDAP attribute.
public static setAttribute ( array &$data, string $attribName, scalar | array | Traversable $value, boolean $append = false ) : void
$data array
$attribName string
$value scalar | array | Traversable
$append boolean
return void

setDateTimeAttribute() public static method

Sets a LDAP date/time attribute.
public static setDateTimeAttribute ( array &$data, string $attribName, integer | array | Traversable $value, boolean $utc = false, boolean $append = false ) : null
$data array
$attribName string
$value integer | array | Traversable
$utc boolean
$append boolean
return null

setPassword() public static method

Sets a LDAP password.
public static setPassword ( array &$data, string $password, string $hashType = self::PASSWORD_HASH_MD5, string | null $attribName = null ) : null
$data array
$password string
$hashType string
$attribName string | null
return null