original_string: public function setPreferencesAttribute($preferences)
      {
          if (is_array($preferences)) {
              $preferences = json_encode($preferences);
          }
  
          $this->attributes['preferences'] = $preferences;
      }
code: public function setPreferencesAttribute($preferences)
      {
          if (is_array($preferences)) {
              $preferences = json_encode($preferences);
          }
  
          $this->attributes['preferences'] = $preferences;
      }
code_tokens: public function setPreferencesAttribute ( $ preferences ) { if ( is_array ( $ preferences ) ) { $ preferences = json_encode ( $ preferences ) ; } $ this -> attributes [ 'preferences' ] = $ preferences ; }
docstring: Set the user's preferences.
  
  @param  string|array  $value
  
  @return void
docstring_tokens: Set the user s preferences .