Example #1
0
 /**
  * @return array
  */
 public function toArray(User $user)
 {
     return array('id' => $user->getID(), 'email' => $user->getEmail(), 'person' => $user->getPerson(), 'password' => $user->getPassword(), 'state' => $user->getState()->getValue(), 'registrationDate' => is_null($user->getRegistrationDate()) ? null : $user->getRegistrationDate()->format('Y-m-d H:i:s'), 'lastLoginDate' => is_null($user->getLastLoginDate()) ? null : $user->getLastLoginDate()->format('Y-m-d H:i:s'));
 }
Example #2
0
 public function testGetSetRegistrationDate()
 {
     $this->user->setRegistrationDate(new DateTime('1970-01-01'));
     $this->assertInstanceOf('DateTime', $this->user->getRegistrationDate());
     $this->assertEquals('1970-01-01', $this->user->getRegistrationDate()->format('Y-m-d'));
 }