original_string: public function delete() {
          global $DB;
  
          $this->delete_attachments();
          $this->remove_associations();
  
          // Get record to pass onto the event.
          $record = $DB->get_record('post', array('id' => $this->id));
          $DB->delete_records('post', array('id' => $this->id));
          core_tag_tag::remove_all_item_tags('core', 'post', $this->id);
  
          $event = \core\event\blog_entry_deleted::create(array(
              'objectid'      => $this->id,
              'relateduserid' => $this->userid
              ));
          $event->add_record_snapshot("post", $record);
          $event->set_blog_entry($this);
          $event->trigger();
      }
code: public function delete() {
          global $DB;
  
          $this->delete_attachments();
          $this->remove_associations();
  
          // Get record to pass onto the event.
          $record = $DB->get_record('post', array('id' => $this->id));
          $DB->delete_records('post', array('id' => $this->id));
          core_tag_tag::remove_all_item_tags('core', 'post', $this->id);
  
          $event = \core\event\blog_entry_deleted::create(array(
              'objectid'      => $this->id,
              'relateduserid' => $this->userid
              ));
          $event->add_record_snapshot("post", $record);
          $event->set_blog_entry($this);
          $event->trigger();
      }
code_tokens: public function delete ( ) { global $ DB ; $ this -> delete_attachments ( ) ; $ this -> remove_associations ( ) ; // Get record to pass onto the event. $ record = $ DB -> get_record ( 'post' , array ( 'id' => $ this -> id ) ) ; $ DB -> delete_records ( 'post' , array ( 'id' => $ this -> id ) ) ; core_tag_tag :: remove_all_item_tags ( 'core' , 'post' , $ this -> id ) ; $ event = \ core \ event \ blog_entry_deleted :: create ( array ( 'objectid' => $ this -> id , 'relateduserid' => $ this -> userid ) ) ; $ event -> add_record_snapshot ( "post" , $ record ) ; $ event -> set_blog_entry ( $ this ) ; $ event -> trigger ( ) ; }
docstring: Deletes this entry from the database. Access control checks must be done by calling code.
  
  @return void
docstring_tokens: Deletes this entry from the database . Access control checks must be done by calling code .