Beispiel #1
0
 /**
  * Checks if the attribute can be set and sets it accordingly.
  *
  * @param  string        $name
  * @param  int|array $value
  * @param  bool       $utc
  * @param  bool       $append
  * @throws Exception\LdapException
  */
 protected function _setDateTimeAttribute($name, $value, $utc, $append)
 {
     $this->assertChangeableAttribute($name);
     Attribute::setDateTimeAttribute($this->currentData, $name, $value, $utc, $append);
 }
Beispiel #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();
     Attribute::setDateTimeAttribute($data, 'ts', $ts, false);
     $this->assertLocalDateTimeString($ts[0], $data['ts'][0]);
     $this->assertLocalDateTimeString($ts[1], $data['ts'][1]);
     $retTs = Attribute::getDateTimeAttribute($data, 'ts');
     $this->assertEquals($ts[0], $retTs[0]);
     $this->assertEquals($ts[1], $retTs[1]);
 }