Esempio n. 1
0
 /**
  * Set status as current
  *
  * @param User   $user
  * @param Status $status
  * @param bool   $reloadUser
  */
 public function setCurrentStatus(User $user, Status $status = null, $reloadUser = true)
 {
     $user->setCurrentStatus($status);
     $this->um->updateUser($user);
     if ($reloadUser) {
         $this->um->reloadUser($user);
     }
 }
Esempio n. 2
0
 /**
  * @param User   $user
  * @param Status $status
  * @param bool   $updateCurrentStatus
  */
 protected function onSuccess(User $user, Status $status, $updateCurrentStatus)
 {
     $status->setUser($user);
     $this->em->persist($status);
     if ($updateCurrentStatus) {
         $user->setCurrentStatus($status);
         $this->um->updateUser($user);
         $this->um->reloadUser($user);
     }
     $this->em->flush();
 }
 public function testReloadUser()
 {
     $user = $this->getUser();
     $this->om->expects($this->once())->method('refresh')->with($this->equalTo($user));
     $this->userManager->reloadUser($user);
 }