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

Create a new user
Автор: Steve Montambeault
public create ( array $credentials, boolean $activate = false ) : Cartalyst\Sentry\Users\UserInterface
$credentials array
$activate boolean
Результат Cartalyst\Sentry\Users\UserInterface
Пример #1
0
 /**
  * Validate and create the user
  *
  * @author Steve Montambeault
  * @link   http://stevemo.ca
  *
  * @param array $data
  *
  * @return \StdClass
  */
 public function create(array $data)
 {
     try {
         if ($this->validator->with($data)->passes()) {
             $this->users->create($data, $data['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;
 }