From 0be1644e75ffdcf695f0c8c85a2ef9bad996f18e Mon Sep 17 00:00:00 2001 From: Antonio Ramirez Date: Fri, 9 Dec 2016 09:36:46 +0100 Subject: [PATCH] remove not required methods --- lib/User/Form/RegistrationForm.php | 45 ------------------------------ 1 file changed, 45 deletions(-) diff --git a/lib/User/Form/RegistrationForm.php b/lib/User/Form/RegistrationForm.php index 54860f6..27a0bad 100644 --- a/lib/User/Form/RegistrationForm.php +++ b/lib/User/Form/RegistrationForm.php @@ -74,49 +74,4 @@ class RegistrationForm extends Model 'password' => Yii::t('user', 'Password'), ]; } - - /** - * Registers a new user account. If registration was successful it will set flash message. - * - * @return bool - */ - public function register() - { - if (!$this->validate()) { - return false; - } - - /** @var User $user */ - $user = Yii::createObject(User::className()); - $user->setScenario('register'); - $this->loadAttributes($user); - - if (!$user->register()) { - return false; - } - - Yii::$app->session->setFlash( - 'info', - Yii::t( - 'user', - 'Your account has been created and a message with further instructions has been sent to your email' - ) - ); - - return true; - } - - /** - * Loads attributes to the user model. You should override this method if you are going to add new fields to the - * registration form. You can read more in special guide. - * - * By default this method set all attributes of this model to the attributes of User model, so you should properly - * configure safe attributes of your User model. - * - * @param User $user - */ - protected function loadAttributes(User $user) - { - $user->setAttributes($this->attributes); - } }