public function File::setFilename in Drupal 10
Same name and namespace in other branches
- 8 core/modules/file/src/Entity/File.php \Drupal\file\Entity\File::setFilename()
- 9 core/modules/file/src/Entity/File.php \Drupal\file\Entity\File::setFilename()
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 60
Class
- File
- Defines the file entity class.
Namespace
Drupal\file\EntityCode
public function setFilename($filename) {
$this
->get('filename')->value = $filename;
}