public function load(ObjectManager $manager)
 {
     for ($i = 1; $i <= 10; $i++) {
         $email = sprintf("*****@*****.**", $i);
         $user = new DiamanteUser($email, 'Test', 'User');
         $apiUser = new ApiUser($email, UserServiceImpl::generateRandomSequence(20), UserServiceImpl::generateRandomSequence(20));
         $apiUser->activate($apiUser->getHash());
         $user->setApiUser($apiUser);
         $user->setDeleted(false);
         $manager->persist($user);
     }
     $manager->flush();
 }
 /**
  * @param DiamanteUser $user
  */
 protected function restoreUser(DiamanteUser $user)
 {
     $user->setDeleted(false);
     $user->updateTimestamp();
     $this->diamanteUserRepository->store($user);
     $this->resetPassword(new User($user->getId(), User::TYPE_DIAMANTE));
 }
 /**
  * @param Command\RegisterCommand $command
  * @param DiamanteUser $user
  */
 protected function restoreUser(Command\RegisterCommand $command, DiamanteUser $user)
 {
     $user->setEmail($command->email);
     $user->setFirstName($command->firstName);
     $user->setLastName($command->lastName);
     $user->setDeleted(false);
     $user->getApiUser()->setPassword($command->password);
     $this->diamanteUserRepository->store($user);
 }