original_string: public function register()
      {
          if ($this->validate()) {
              $class = $this->userClass;
              $user = new $class(['password' => $this->password]);
              /* @var $user User */
              $profile = $user->createProfile(['nickname' => $this->nickname, 'first_name' => $this->first_name, 'last_name' => $this->last_name, 'gender' => $this->gender]);
              $models[] = $profile;
              if (is_string($this->username)) {
                  $username = $user->createUsername($this->username);
                  $models[] = $username;
              }
              $result = $user->register($models);
              if ($result == true) {
                  $this->model = $user;
              }
              return $result;
          }
          return false;
      }
code: public function register()
      {
          if ($this->validate()) {
              $class = $this->userClass;
              $user = new $class(['password' => $this->password]);
              /* @var $user User */
              $profile = $user->createProfile(['nickname' => $this->nickname, 'first_name' => $this->first_name, 'last_name' => $this->last_name, 'gender' => $this->gender]);
              $models[] = $profile;
              if (is_string($this->username)) {
                  $username = $user->createUsername($this->username);
                  $models[] = $username;
              }
              $result = $user->register($models);
              if ($result == true) {
                  $this->model = $user;
              }
              return $result;
          }
          return false;
      }
code_tokens: public function register ( ) { if ( $ this -> validate ( ) ) { $ class = $ this -> userClass ; $ user = new $ class ( [ 'password' => $ this -> password ] ) ; /* @var $user User */ $ profile = $ user -> createProfile ( [ 'nickname' => $ this -> nickname , 'first_name' => $ this -> first_name , 'last_name' => $ this -> last_name , 'gender' => $ this -> gender ] ) ; $ models [ ] = $ profile ; if ( is_string ( $ this -> username ) ) { $ username = $ user -> createUsername ( $ this -> username ) ; $ models [ ] = $ username ; } $ result = $ user -> register ( $ models ) ; if ( $ result == true ) { $ this -> model = $ user ; } return $ result ; } return false ; }
docstring: Register user with current model.
  @return bool
docstring_tokens: Register user with current model .