original_string: protected function copy_page_files($filearea, $itemid, $newitemid, $contextid) {
          $fs = get_file_storage();
          $files = $fs->get_area_files($contextid, 'mod_lesson', $filearea, $itemid);
          foreach ($files as $file) {
              $fieldupdates = array('itemid' => $newitemid);
              $fs->create_file_from_storedfile($fieldupdates, $file);
          }
      }
code: protected function copy_page_files($filearea, $itemid, $newitemid, $contextid) {
          $fs = get_file_storage();
          $files = $fs->get_area_files($contextid, 'mod_lesson', $filearea, $itemid);
          foreach ($files as $file) {
              $fieldupdates = array('itemid' => $newitemid);
              $fs->create_file_from_storedfile($fieldupdates, $file);
          }
      }
code_tokens: protected function copy_page_files ( $ filearea , $ itemid , $ newitemid , $ contextid ) { $ fs = get_file_storage ( ) ; $ files = $ fs -> get_area_files ( $ contextid , 'mod_lesson' , $ filearea , $ itemid ) ; foreach ( $ files as $ file ) { $ fieldupdates = array ( 'itemid' => $ newitemid ) ; $ fs -> create_file_from_storedfile ( $ fieldupdates , $ file ) ; } }
docstring: Copy the files from one page to another.
  
  @param  string $filearea Area that the files are stored.
  @param  int $itemid Item ID.
  @param  int $newitemid The item ID for the new page.
  @param  int $contextid Context ID for this page.
  @return void.
docstring_tokens: Copy the files from one page to another .