Zend_Ldap_Attribute::getDateTimeAttribute PHP Method

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
    public static function getDateTimeAttribute(array $data, $attribName, $index = null)
    {
        $values = self::getAttribute($data, $attribName, $index);
        if (is_array($values)) {
            for ($i = 0; $i < count($values); $i++) {
                $newVal = self::_valueFromLdapDateTime($values[$i]);
                if ($newVal !== null) {
                    $values[$i] = $newVal;
                }
            }
        } else {
            $newVal = self::_valueFromLdapDateTime($values);
            if ($newVal !== null) {
                $values = $newVal;
            }
        }
        return $values;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Gets a LDAP date/time attribute.
  *
  * This is an offline method.
  *
  * @param  string  $name
  * @param  integer $index
  * @return array|integer
  * @throws Zend_Ldap_Exception
  */
 public function getDateTimeAttribute($name, $index = null)
 {
     return Zend_Ldap_Attribute::getDateTimeAttribute($this->_currentData, $name, $index);
 }
All Usage Examples Of Zend_Ldap_Attribute::getDateTimeAttribute