original_string: public function delete_area_files_select($contextid, $component,
              $filearea, $itemidstest, array $params = null) {
          global $DB;
  
          $where = "contextid = :contextid
                  AND component = :component
                  AND filearea = :filearea
                  AND itemid $itemidstest";
          $params['contextid'] = $contextid;
          $params['component'] = $component;
          $params['filearea'] = $filearea;
  
          $filerecords = $DB->get_recordset_select('files', $where, $params);
          foreach ($filerecords as $filerecord) {
              $this->get_file_instance($filerecord)->delete();
          }
          $filerecords->close();
      }
code: public function delete_area_files_select($contextid, $component,
              $filearea, $itemidstest, array $params = null) {
          global $DB;
  
          $where = "contextid = :contextid
                  AND component = :component
                  AND filearea = :filearea
                  AND itemid $itemidstest";
          $params['contextid'] = $contextid;
          $params['component'] = $component;
          $params['filearea'] = $filearea;
  
          $filerecords = $DB->get_recordset_select('files', $where, $params);
          foreach ($filerecords as $filerecord) {
              $this->get_file_instance($filerecord)->delete();
          }
          $filerecords->close();
      }
code_tokens: public function delete_area_files_select ( $ contextid , $ component , $ filearea , $ itemidstest , array $ params = null ) { global $ DB ; $ where = "contextid = :contextid
                  AND component = :component
                  AND filearea = :filearea
                  AND itemid $itemidstest" ; $ params [ 'contextid' ] = $ contextid ; $ params [ 'component' ] = $ component ; $ params [ 'filearea' ] = $ filearea ; $ filerecords = $ DB -> get_recordset_select ( 'files' , $ where , $ params ) ; foreach ( $ filerecords as $ filerecord ) { $ this -> get_file_instance ( $ filerecord ) -> delete ( ) ; } $ filerecords -> close ( ) ; }
docstring: Delete all the files from certain areas where itemid is limited by an
  arbitrary bit of SQL.
  
  @param int $contextid the id of the context the files belong to. Must be given.
  @param string $component the owning component. Must be given.
  @param string $filearea the file area name. Must be given.
  @param string $itemidstest an SQL fragment that the itemid must match. Used
  in the query like WHERE itemid $itemidstest. Must used named parameters,
  and may not used named parameters called contextid, component or filearea.
  @param array $params any query params used by $itemidstest.
docstring_tokens: Delete all the files from certain areas where itemid is limited by an arbitrary bit of SQL .