original_string: public function save_user_preview_options($newoptions) {
          foreach ($this->get_user_pref_fields() as $field) {
              if (isset($newoptions->$field)) {
                  set_user_preference(self::OPTIONPREFIX . $field, $newoptions->$field);
              }
          }
      }
code: public function save_user_preview_options($newoptions) {
          foreach ($this->get_user_pref_fields() as $field) {
              if (isset($newoptions->$field)) {
                  set_user_preference(self::OPTIONPREFIX . $field, $newoptions->$field);
              }
          }
      }
code_tokens: public function save_user_preview_options ( $ newoptions ) { foreach ( $ this -> get_user_pref_fields ( ) as $ field ) { if ( isset ( $ newoptions -> $ field ) ) { set_user_preference ( self :: OPTIONPREFIX . $ field , $ newoptions -> $ field ) ; } } }
docstring: Save a change to the user's preview options to the database.
  @param object $newoptions
docstring_tokens: Save a change to the user s preview options to the database .