diff --git a/app/forms/Registration.php b/app/forms/Registration.php index 785bee1..418402e 100644 --- a/app/forms/Registration.php +++ b/app/forms/Registration.php @@ -5,21 +5,17 @@ namespace App\Form; /** * Models */ -use App\Model\Data\User as UserModel; +use App\Model\Data\User; /** * Phalcon Form */ - -use App\Model\Data\User; use Httpcb\Form as FormBase, Phalcon\Forms\Element as FormElement; /** * Element types */ - -use Httpcb\OAuth\UserData\UserDataInterface; use Phalcon\Forms\Element\Text, Phalcon\Forms\Element\Password, Phalcon\Forms\Element\Submit; @@ -27,7 +23,8 @@ use Phalcon\Forms\Element\Text, /** * Validators */ -use Phalcon\Validation\Validator\Callback as CallbackValidator, +use Phalcon\Validation, + Phalcon\Validation\Validator\Callback as CallbackValidator, Phalcon\Validation\Validator\Alnum as AlnumValidator, Phalcon\Validation\Validator\Email as EmailValidator, Phalcon\Validation\Validator\StringLength as StringLengthValidator, @@ -39,7 +36,7 @@ class Registration extends FormBase { public function initialize() { - $this->setValidation(new \Phalcon\Validation()); + $this->setValidation(new Validation()); // Username $username = new Text('username', array( @@ -107,15 +104,4 @@ class Registration extends FormBase $submit = new Submit('submit', array('class' => 'button button-success', 'value' => 'Register')); $this->add($submit); } - - public function bind(array $data, $entity, $whitelist = null) - { - parent::bind($data, $entity, $whitelist); - - if ($entity instanceof User && $this->getEntity() instanceof UserDataInterface) { - $provider = $this->getEntity()->getProvider(); - $id = $this->getEntity()->getId(); - $entity->setOAuthId($provider, $id); - } - } }