File::setFilename

public File::setFilename($filename)

Sets the name of the file.

Parameters

string $filename: The file name that corresponds to this file. May differ from the basename of the URI and changing the filename does not change the URI.

Overrides FileInterface::setFilename

File

core/modules/file/src/Entity/File.php, line 50

Class

File
Defines the file entity class.

Namespace

Drupal\file\Entity

Code

public function setFilename($filename) {
  $this->get('filename')->value = $filename;
}
doc_Drupal
2016-10-29 09:13:16
Comments
Leave a Comment

Please login to continue.