public function __construct(UserLogin $userLogin, DTOBuilderFactoryInterface $dtoBuilderFactory)
 {
     $this->entity = $userLogin;
     $this->dtoBuilderFactory = $dtoBuilderFactory;
     $this->entityDTO = new UserLoginDTO();
     $this->setId();
     $this->entityDTO->created = $this->entity->getCreated();
     $this->entityDTO->email = $userLogin->getEmail();
     $this->entityDTO->ip4 = $userLogin->getIp4();
     $this->entityDTO->result = $this->dtoBuilderFactory->getUserLoginResultTypeDTOBuilder($userLogin->getResult())->build();
 }
Example #2
0
 public function addUserLogin(UserLogin $userLogin)
 {
     $this->userLogins[] = $userLogin;
     if ($userLogin->getResult()->isSuccess()) {
         $this->incrementTotalLogins();
     }
 }