original_string: protected function & storeUserData(&$user = null)
      {
          // If no user is passed - create it
          if (!isset($user)) {
              $user = new $this->dbTable(false);
          }
  
          // Store social data for user
          $user[$this->dbIdField]         = $this->user->socialID;
          $user[$this->dbNameField]       = strlen($this->user->name) ? $this->user->name : $user[$this->dbNameField];
          $user[$this->dbSurnameField]    = strlen($this->user->surname) ? $this->user->surname : $user[$this->dbSurnameField] ;
          $user[$this->dbGenderField]     = strlen($this->user->gender) ? $this->user->gender : $user[$this->dbGenderField] ;
          $user[$this->dbBirthdayField]   = max($user[$this->dbBirthdayField],$this->user->birthday);
          $user[$this->dbPhotoField]      = strlen($this->user->photo) ? $this->user->photo : $user[$this->dbPhotoField];
  
          // If no email is passed - set hashed socialID as email
          if (!strlen($this->user->email)) {
              if (!strlen($user->email)) {
                  $user[$this->dbEmailField] = md5($this->user->socialID);
              }
          } else {
              $user[$this->dbEmailField] = $this->user->email;
          }
  
          $user->save();
  
          return $user;
      }
code: protected function & storeUserData(&$user = null)
      {
          // If no user is passed - create it
          if (!isset($user)) {
              $user = new $this->dbTable(false);
          }
  
          // Store social data for user
          $user[$this->dbIdField]         = $this->user->socialID;
          $user[$this->dbNameField]       = strlen($this->user->name) ? $this->user->name : $user[$this->dbNameField];
          $user[$this->dbSurnameField]    = strlen($this->user->surname) ? $this->user->surname : $user[$this->dbSurnameField] ;
          $user[$this->dbGenderField]     = strlen($this->user->gender) ? $this->user->gender : $user[$this->dbGenderField] ;
          $user[$this->dbBirthdayField]   = max($user[$this->dbBirthdayField],$this->user->birthday);
          $user[$this->dbPhotoField]      = strlen($this->user->photo) ? $this->user->photo : $user[$this->dbPhotoField];
  
          // If no email is passed - set hashed socialID as email
          if (!strlen($this->user->email)) {
              if (!strlen($user->email)) {
                  $user[$this->dbEmailField] = md5($this->user->socialID);
              }
          } else {
              $user[$this->dbEmailField] = $this->user->email;
          }
  
          $user->save();
  
          return $user;
      }
code_tokens: protected function & storeUserData ( & $ user = null ) { // If no user is passed - create it if ( ! isset ( $ user ) ) { $ user = new $ this -> dbTable ( false ) ; } // Store social data for user $ user [ $ this -> dbIdField ] = $ this -> user -> socialID ; $ user [ $ this -> dbNameField ] = strlen ( $ this -> user -> name ) ? $ this -> user -> name : $ user [ $ this -> dbNameField ] ; $ user [ $ this -> dbSurnameField ] = strlen ( $ this -> user -> surname ) ? $ this -> user -> surname : $ user [ $ this -> dbSurnameField ] ; $ user [ $ this -> dbGenderField ] = strlen ( $ this -> user -> gender ) ? $ this -> user -> gender : $ user [ $ this -> dbGenderField ] ; $ user [ $ this -> dbBirthdayField ] = max ( $ user [ $ this -> dbBirthdayField ] , $ this -> user -> birthday ) ; $ user [ $ this -> dbPhotoField ] = strlen ( $ this -> user -> photo ) ? $ this -> user -> photo : $ user [ $ this -> dbPhotoField ] ; // If no email is passed - set hashed socialID as email if ( ! strlen ( $ this -> user -> email ) ) { if ( ! strlen ( $ user -> email ) ) { $ user [ $ this -> dbEmailField ] = md5 ( $ this -> user -> socialID ) ; } } else { $ user [ $ this -> dbEmailField ] = $ this -> user -> email ; } $ user -> save ( ) ; return $ user ; }
docstring: Store current social user data in database
  
  @param \samson\activerecord\dbRecord $user
  
  @return \samson\activerecord\dbRecord Stored user database record
docstring_tokens: Store current social user data in database