Update File.php

Adding warning, took me a couple hours to figure this out...

The file does not get moved because of this line:
https://github.com/silverstripe/silverstripe-framework/blob/3.1/filesystem/File.php#L515

Maybe add to the method doc, telling people to set ParentId and Name instead if they want to change the location of a file (if that's the correct method).
This commit is contained in:
Igor 2014-02-26 14:09:09 +13:00
parent 8ab0fd879d
commit 3e5ac7cdcc

View File

@ -732,7 +732,7 @@ class File extends DataObject {
}
/**
* Does not change the filesystem itself, please use {@link write()} for this.
* Caution: this does not change the location of the file on the filesystem.
*/
public function setFilename($val) {
$this->setField('Filename', $val);