setDateTimeAttribute() публичный статический Метод

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
Результат null
Пример #1
0
 /**
  * Checks if the attribute can be set and sets it accordingly.
  *
  * @param  string        $name
  * @param  integer|array $value
  * @param  boolean       $utc
  * @param  boolean       $append
  * @throws Zend_Ldap_Exception
  */
 protected function _setDateTimeAttribute($name, $value, $utc, $append)
 {
     $this->_assertChangeableAttribute($name);
     Zend_Ldap_Attribute::setDateTimeAttribute($this->_currentData, $name, $value, $utc, $append);
 }
Пример #2
0
 public function testGetDateTimeValueFromArray()
 {
     $ts = array();
     $ts[] = mktime(12, 30, 30, 6, 25, 2008);
     $ts[] = mktime(1, 25, 30, 1, 2, 2008);
     $data = array();
     Zend_Ldap_Attribute::setDateTimeAttribute($data, 'ts', $ts, false);
     $this->_assertLocalDateTimeString($ts[0], $data['ts'][0]);
     $this->_assertLocalDateTimeString($ts[1], $data['ts'][1]);
     $retTs = Zend_Ldap_Attribute::getDateTimeAttribute($data, 'ts');
     $this->assertEquals($ts[0], $retTs[0]);
     $this->assertEquals($ts[1], $retTs[1]);
 }