frontend/models/SignupForm.php
/**
     * Signs user up.
     *
     * @return User|null the saved model or null if saving fails
     */
Signs user up.
@return User|null the saved model or null if saving fails
Signs user up . @return User|null the saved model or null if saving fails
public function signup() {
        $guest = $this->usercheck();
        if ($guest) {
            return $guest;
        } else {
            if (!$this->validate()) {
                return null;
            }
            $user = new User();
            $user->first_name = $this->first_name;
            $user->email = $this->email;
            $user->dob = date("Y-m-d", strtotime($this->dob));
            $user->country = $this->country;
            $user->mobile_no = $this->contact_no;
            $user->email_verification = 0;
            $user->setPassword($this->password);
            $user->generateAuthKey();
            return $user->save() ? $user : null;
        }
    }
public function signup ( ) { $ guest = $ this -> usercheck ( ) ; if ( $ guest ) { return $ guest ; } else { if ( ! $ this -> validate ( ) ) { return null ; } $ user = new User ( ) ; $ user -> first_name = $ this -> first_name ; $ user -> email = $ this -> email ; $ user -> dob = date ( " Y-m-d " , strtotime ( $ this -> dob ) ) ; $ user -> country = $ this -> country ; $ user -> mobile_no = $ this -> contact_no ; $ user -> email_verification = 0 ; $ user -> setPassword ( $ this -> password ) ; $ user -> generateAuthKey ( ) ; return $ user -> save ( ) ? $ user : null ; } }
Signs user up.
Signs user up .