Cartalyst\Sentinel\Activations\ActivationRepositoryInterface::completed PHP Method

completed() public method

Checks if a valid activation has been completed.
public completed ( Cartalyst\Sentinel\Users\UserInterface $user ) : Cartalyst\Sentinel\Activations\ActivationInterface | boolean
$user Cartalyst\Sentinel\Users\UserInterface
return Cartalyst\Sentinel\Activations\ActivationInterface | boolean
    public function completed(UserInterface $user);

Usage Example

 /**
  * Checks the activation status of the given user.
  *
  * @param  \Cartalyst\Sentinel\Users\UserInterface  $user
  * @return bool
  * @throws \Cartalyst\Sentinel\Checkpoints\NotActivatedException
  */
 protected function checkActivation(UserInterface $user)
 {
     $completed = $this->activations->completed($user);
     if (!$completed) {
         $exception = new NotActivatedException('Your account has not been activated yet.');
         $exception->setUser($user);
         throw $exception;
     }
 }