register() публичный Метод

Registers a user by giving the required credentials and an optional flag for whether to activate the user.
Автор: Steve Montambeault
public register ( array $credentials, boolean $activate = false ) : Cartalyst\Sentry\Users\UserInterface
$credentials array
$activate boolean
Результат Cartalyst\Sentry\Users\UserInterface
Пример #1
0
 /**
  * Register a new user
  *
  * @author Steve Montambeault
  * @link   http://stevemo.ca
  *
  * @param array $credentials
  * @param bool  $activate
  *
  * @return bool
  */
 public function register(array $credentials, $activate)
 {
     try {
         if ($this->validator->with($credentials)->passes()) {
             $this->users->register($credentials, $activate);
             return true;
         }
     } catch (LoginRequiredException $e) {
         $this->validator->add('LoginRequiredException', $e->getMessage());
     } catch (PasswordRequiredException $e) {
         $this->validator->add('PasswordRequiredException', $e->getMessage());
     } catch (UserExistsException $e) {
         $this->validator->add('UserExistsException', $e->getMessage());
     }
     return false;
 }