Esempio n. 1
0
 /**
  * @param User $userModel
  *
  * @return UserEntity
  */
 public static function build(User $userModel)
 {
     $user = new UserEntity(new UserId($userModel->getId()), $userModel->getName(), $userModel->getEmail(), $userModel->getUsername(), [$userModel->getRoles()], $userModel->getSalt(), $userModel->getPassword());
     $user->setSurname($userModel->getSurname());
     $user->setEnabled($userModel->isEnabled());
     $user->setCreatedAt($userModel->getCreatedAt());
     $user->setAccountNonExpired($userModel->isAccountNonExpired());
     $user->setAccountNonLocked($userModel->isAccountNonLocked());
     $user->setCredentialsNonExpired($userModel->isCredentialsNonExpired());
     return $user;
 }