Skip to content

Commit

Permalink
MDL-14591 improved docs when copying files - thanks Nicolas forspotti…
Browse files Browse the repository at this point in the history
…ng this
  • Loading branch information
skodak committed Oct 14, 2009
1 parent 234c18e commit 72d0aed
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/file/file_storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,16 @@ public function create_directory($contextid, $filearea, $itemid, $filepath, $use
/**
* Add new local file based on existing local file
* @param mixed $file_record object or array describing changes
* @param int $fid id of existing local file
* @return object stored_file instance
* @param mixed $fileorid id or stored_file instance of the existing local file
* @return object stored_file instance of newly created file
*/
public function create_file_from_storedfile($file_record, $fid) {
public function create_file_from_storedfile($file_record, $fileorid) {
global $DB;

if ($fid instanceof stored_file) {
$fid = $fid->get_id();
if ($fileorid instanceof stored_file) {
$fid = $fileorid->get_id();
} else {
$fid = $fileorid;
}

$file_record = (array)$file_record; // we support arrays too, do not modify the submitted record!
Expand Down

0 comments on commit 72d0aed

Please sign in to comment.