original_string: public function edit($params=array(), $form=null, $summaryoptions=array(), $attachmentoptions=array()) {
          global $CFG, $DB;
  
          $sitecontext = context_system::instance();
          $entry = $this;
  
          $this->form = $form;
          foreach ($params as $var => $val) {
              $entry->$var = $val;
          }
  
          $entry = file_postupdate_standard_editor($entry, 'summary', $summaryoptions, $sitecontext, 'blog', 'post', $entry->id);
          $entry = file_postupdate_standard_filemanager($entry,
                                                        'attachment',
                                                        $attachmentoptions,
                                                        $sitecontext,
                                                        'blog',
                                                        'attachment',
                                                        $entry->id);
  
          if (!empty($CFG->useblogassociations)) {
              $entry->add_associations();
          }
  
          $entry->lastmodified = time();
  
          // Update record.
          $DB->update_record('post', $entry);
          core_tag_tag::set_item_tags('core', 'post', $entry->id, context_user::instance($this->userid), $entry->tags);
  
          $event = \core\event\blog_entry_updated::create(array(
              'objectid'      => $entry->id,
              'relateduserid' => $entry->userid
          ));
          $event->set_blog_entry($entry);
          $event->trigger();
      }
code: public function edit($params=array(), $form=null, $summaryoptions=array(), $attachmentoptions=array()) {
          global $CFG, $DB;
  
          $sitecontext = context_system::instance();
          $entry = $this;
  
          $this->form = $form;
          foreach ($params as $var => $val) {
              $entry->$var = $val;
          }
  
          $entry = file_postupdate_standard_editor($entry, 'summary', $summaryoptions, $sitecontext, 'blog', 'post', $entry->id);
          $entry = file_postupdate_standard_filemanager($entry,
                                                        'attachment',
                                                        $attachmentoptions,
                                                        $sitecontext,
                                                        'blog',
                                                        'attachment',
                                                        $entry->id);
  
          if (!empty($CFG->useblogassociations)) {
              $entry->add_associations();
          }
  
          $entry->lastmodified = time();
  
          // Update record.
          $DB->update_record('post', $entry);
          core_tag_tag::set_item_tags('core', 'post', $entry->id, context_user::instance($this->userid), $entry->tags);
  
          $event = \core\event\blog_entry_updated::create(array(
              'objectid'      => $entry->id,
              'relateduserid' => $entry->userid
          ));
          $event->set_blog_entry($entry);
          $event->trigger();
      }
code_tokens: public function edit ( $ params = array ( ) , $ form = null , $ summaryoptions = array ( ) , $ attachmentoptions = array ( ) ) { global $ CFG , $ DB ; $ sitecontext = context_system :: instance ( ) ; $ entry = $ this ; $ this -> form = $ form ; foreach ( $ params as $ var => $ val ) { $ entry -> $ var = $ val ; } $ entry = file_postupdate_standard_editor ( $ entry , 'summary' , $ summaryoptions , $ sitecontext , 'blog' , 'post' , $ entry -> id ) ; $ entry = file_postupdate_standard_filemanager ( $ entry , 'attachment' , $ attachmentoptions , $ sitecontext , 'blog' , 'attachment' , $ entry -> id ) ; if ( ! empty ( $ CFG -> useblogassociations ) ) { $ entry -> add_associations ( ) ; } $ entry -> lastmodified = time ( ) ; // Update record. $ DB -> update_record ( 'post' , $ entry ) ; core_tag_tag :: set_item_tags ( 'core' , 'post' , $ entry -> id , context_user :: instance ( $ this -> userid ) , $ entry -> tags ) ; $ event = \ core \ event \ blog_entry_updated :: create ( array ( 'objectid' => $ entry -> id , 'relateduserid' => $ entry -> userid ) ) ; $ event -> set_blog_entry ( $ entry ) ; $ event -> trigger ( ) ; }
docstring: Updates this entry in the database. Access control checks must be done by calling code.
  
  @param array       $params            Entry parameters.
  @param moodleform  $form              Used for attachments.
  @param array       $summaryoptions    Summary options.
  @param array       $attachmentoptions Attachment options.
  
  @return void
docstring_tokens: Updates this entry in the database . Access control checks must be done by calling code .