5 use Drupal\Core\Entity\ContentEntityInterface;
6 use Drupal\user\EntityOwnerInterface;
7 use Drupal\Core\Entity\EntityChangedInterface;
10 * Defines getter and setter methods for file entity base fields.
14 interface FileInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface {
17 * Returns the name of the file.
19 * This may differ from the basename of the URI if the file is renamed to
20 * avoid overwriting an existing file.
25 public function getFilename();
28 * Sets the name of the file.
30 * @param string $filename
31 * The file name that corresponds to this file. May differ from the basename
32 * of the URI and changing the filename does not change the URI.
34 public function setFilename($filename);
37 * Returns the URI of the file.
40 * The URI of the file, e.g. public://directory/file.jpg.
42 public function getFileUri();
45 * Sets the URI of the file.
48 * The URI of the file, e.g. public://directory/file.jpg. Does not change
49 * the location of the file.
51 public function setFileUri($uri);
54 * Returns the MIME type of the file.
57 * The MIME type of the file, e.g. image/jpeg or text/xml.
59 public function getMimeType();
62 * Sets the MIME type of the file.
65 * The MIME type of the file, e.g. image/jpeg or text/xml.
67 public function setMimeType($mime);
70 * Returns the size of the file.
73 * The size of the file in bytes.
75 public function getSize();
78 * Sets the size of the file.
81 * The size of the file in bytes.
83 public function setSize($size);
86 * Returns TRUE if the file is permanent.
89 * TRUE if the file status is permanent.
91 public function isPermanent();
94 * Returns TRUE if the file is temporary.
97 * TRUE if the file status is temporary.
99 public function isTemporary();
102 * Sets the file status to permanent.
104 public function setPermanent();
107 * Sets the file status to temporary.
109 public function setTemporary();
112 * Returns the file entity creation timestamp.
115 * Creation timestamp of the file entity.
117 public function getCreatedTime();