original_string: function delete_content($recordid=0) {
          global $DB;
  
          if ($recordid) {
              $conditions = array('fieldid'=>$this->field->id, 'recordid'=>$recordid);
          } else {
              $conditions = array('fieldid'=>$this->field->id);
          }
  
          $rs = $DB->get_recordset('data_content', $conditions);
          if ($rs->valid()) {
              $fs = get_file_storage();
              foreach ($rs as $content) {
                  $fs->delete_area_files($this->context->id, 'mod_data', 'content', $content->id);
              }
          }
          $rs->close();
  
          return $DB->delete_records('data_content', $conditions);
      }
code: function delete_content($recordid=0) {
          global $DB;
  
          if ($recordid) {
              $conditions = array('fieldid'=>$this->field->id, 'recordid'=>$recordid);
          } else {
              $conditions = array('fieldid'=>$this->field->id);
          }
  
          $rs = $DB->get_recordset('data_content', $conditions);
          if ($rs->valid()) {
              $fs = get_file_storage();
              foreach ($rs as $content) {
                  $fs->delete_area_files($this->context->id, 'mod_data', 'content', $content->id);
              }
          }
          $rs->close();
  
          return $DB->delete_records('data_content', $conditions);
      }
code_tokens: function delete_content ( $ recordid = 0 ) { global $ DB ; if ( $ recordid ) { $ conditions = array ( 'fieldid' => $ this -> field -> id , 'recordid' => $ recordid ) ; } else { $ conditions = array ( 'fieldid' => $ this -> field -> id ) ; } $ rs = $ DB -> get_recordset ( 'data_content' , $ conditions ) ; if ( $ rs -> valid ( ) ) { $ fs = get_file_storage ( ) ; foreach ( $ rs as $ content ) { $ fs -> delete_area_files ( $ this -> context -> id , 'mod_data' , 'content' , $ content -> id ) ; } } $ rs -> close ( ) ; return $ DB -> delete_records ( 'data_content' , $ conditions ) ; }
docstring: Delete all content associated with the field
  
  @global object
  @param int $recordid
  @return bool
docstring_tokens: Delete all content associated with the field