protected function store_combined_file($tmpfile, $contextid, $itemid, $partial = false) {
        // Store the file.
        $record = $this->get_stored_file_record($contextid, $itemid, $partial);
        $fs = get_file_storage();

        // Delete existing files first.
        $fs->delete_area_files($record->contextid, $record->component, $record->filearea, $record->itemid);

        // This was a combined pdf.
        $file = $fs->create_file_from_pathname($record, $tmpfile);

        $this->set_combined_file($file);

        return $this;
    }
protected function store_combined_file($tmpfile, $contextid, $itemid, $partial = false) {
        // Store the file.
        $record = $this->get_stored_file_record($contextid, $itemid, $partial);
        $fs = get_file_storage();

        // Delete existing files first.
        $fs->delete_area_files($record->contextid, $record->component, $record->filearea, $record->itemid);

        // This was a combined pdf.
        $file = $fs->create_file_from_pathname($record, $tmpfile);

        $this->set_combined_file($file);

        return $this;
    }
protected function store_combined_file ( $ tmpfile , $ contextid , $ itemid , $ partial = false ) { // Store the file. $ record = $ this -> get_stored_file_record ( $ contextid , $ itemid , $ partial ) ; $ fs = get_file_storage ( ) ; // Delete existing files first. $ fs -> delete_area_files ( $ record -> contextid , $ record -> component , $ record -> filearea , $ record -> itemid ) ; // This was a combined pdf. $ file = $ fs -> create_file_from_pathname ( $ record , $ tmpfile ) ; $ this -> set_combined_file ( $ file ) ; return $ this ; }
Store the combined file in the file_storage API.

@param   string $tmpfile The path to the file on disk to be stored.
@param   int $contextid The contextid for the file to be stored under
@param   int $itemid The itemid for the file to be stored under
@param   boolean $partial The combined pdf contains only some of the source files.
@return  $this
Store the combined file in the file_storage API .