Defines the file entity class.
@Plugin(
id = "file",
label = @Translation("File"),
module = "file",
controller_class = "Drupal\file\FileStorageController",
base_table = "file_managed",
static_cache = FALSE,
entity_keys = {
"id" = "fid",
"label" = "filename",
"uuid" = "uuid"
},
view_modes = {
"full" = {
"label" = "File default",
"custom_settings" = FALSE
}
}
)
Expanded class hierarchy of File
class File extends Entity implements ContentEntityInterface {
/**
* The file ID.
*
* @var integer
*/
public $fid;
/**
* The file UUID.
*
* @var string
*/
public $uuid;
/**
* The file language code.
*
* @var string
*/
public $langcode = LANGUAGE_NOT_SPECIFIED;
/**
* The uid of the user who is associated with the file.
*
* @var integer
*/
public $uid;
/**
* Name of the file with no path components.
*
* This may differ from the basename of the URI if the file is renamed to
* avoid overwriting an existing file.
*
* @var string
*/
public $filename;
/**
* The URI to access the file (either local or remote).
*
* @var string
*/
public $uri;
/**
* The file's MIME type.
*
* @var string
*/
public $filemime;
/**
* The size of the file in bytes.
*
* @var integer
*/
public $filesize;
/**
* A field indicating the status of the file.
*
* Two status are defined in core: temporary (0) and permanent (1).
* Temporary files older than DRUPAL_MAXIMUM_TEMP_FILE_AGE will be removed
* during a cron run.
*
* @var integer
*/
public $status;
/**
* UNIX timestamp for when the file was last saved.
*
* @var integer
*/
public $timestamp;
/**
* Overrides Drupal\Core\Entity\Entity::id().
*/
public function id() {
return $this->fid;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Entity:: |
protected | property | Boolean indicating whether the entity should be forced to be new. | |
Entity:: |
protected | property | The entity type. | |
Entity:: |
protected | property | Indicates whether this is the default revision. | 1 |
Entity:: |
protected | property | Boolean indicating whether a new revision should be created on save. | |
Entity:: |
public | function |
Implements AccessibleInterface::access(). Overrides AccessibleInterface:: |
|
Entity:: |
public | function |
Implements EntityInterface::bundle(). Overrides EntityInterface:: |
4 |
Entity:: |
public | function |
Implements EntityInterface::createDuplicate(). Overrides EntityInterface:: |
3 |
Entity:: |
public | function |
Implements EntityInterface::delete(). Overrides EntityInterface:: |
|
Entity:: |
public | function |
Implements EntityInterface::enforceIsNew(). Overrides EntityInterface:: |
|
Entity:: |
public | function |
Implements EntityInterface::entityInfo(). Overrides EntityInterface:: |
|
Entity:: |
public | function |
Implements EntityInterface::entityType(). Overrides EntityInterface:: |
|
Entity:: |
public | function |
Implements EntityInterface::get(). Overrides ComplexDataInterface:: |
2 |
Entity:: |
public | function | Implements ComplexDataInterface::getIterator(). | 1 |
Entity:: |
public | function |
Implements ComplexDataInterface::getProperties(). Overrides ComplexDataInterface:: |
1 |
Entity:: |
public | function |
Implements ComplexDataInterface::getPropertyDefinition(). Overrides ComplexDataInterface:: |
1 |
Entity:: |
public | function |
Implements ComplexDataInterface::getPropertyDefinitions(). Overrides ComplexDataInterface:: |
1 |
Entity:: |
public | function |
Implements ComplexDataInterface::getPropertyValues(). Overrides ComplexDataInterface:: |
1 |
Entity:: |
public | function |
Implements Drupal\Core\Entity\EntityInterface::getRevisionId(). Overrides EntityInterface:: |
3 |
Entity:: |
public | function |
Implements TranslatableInterface::getTranslation(). Overrides TranslatableInterface:: |
1 |
Entity:: |
public | function |
Implements TranslatableInterface::getTranslationLanguages(). Overrides TranslatableInterface:: |
1 |
Entity:: |
public | function |
Implements Drupal\Core\Entity\EntityInterface::isDefaultRevision(). Overrides EntityInterface:: |
1 |
Entity:: |
public | function |
Implements ComplexDataInterface::isEmpty(). Overrides ComplexDataInterface:: |
1 |
Entity:: |
public | function |
Implements EntityInterface::isNew(). Overrides EntityInterface:: |
1 |
Entity:: |
public | function |
Implements EntityInterface::isNewRevision(). Overrides EntityInterface:: |
|
Entity:: |
public | function |
Implements EntityInterface::label(). Overrides EntityInterface:: |
1 |
Entity:: |
public | function |
Implements TranslatableInterface::language(). Overrides TranslatableInterface:: |
1 |
Entity:: |
public | function |
Implements EntityInterface::save(). Overrides EntityInterface:: |
3 |
Entity:: |
public | function |
Implements ComplexDataInterface::set(). Overrides ComplexDataInterface:: |
2 |
Entity:: |
public | function |
Implements EntityInterface::setNewRevision(). Overrides EntityInterface:: |
|
Entity:: |
public | function |
Implements ComplexDataInterface::setPropertyValues(). Overrides ComplexDataInterface:: |
1 |
Entity:: |
public | function | Returns the languages the entity is translated to. | |
Entity:: |
public | function |
Implements EntityInterface::uri(). Overrides EntityInterface:: |
1 |
Entity:: |
public | function |
Implements EntityInterface::uuid(). Overrides EntityInterface:: |
1 |
Entity:: |
public | function | Constructs an Entity object. | 2 |
File:: |
public | property | The file ID. | |
File:: |
public | property | The file's MIME type. | |
File:: |
public | property | Name of the file with no path components. | |
File:: |
public | property | The size of the file in bytes. | |
File:: |
public | property |
The file language code. Overrides Entity:: |
|
File:: |
public | property | A field indicating the status of the file. | |
File:: |
public | property | UNIX timestamp for when the file was last saved. | |
File:: |
public | property | The uid of the user who is associated with the file. | |
File:: |
public | property | The URI to access the file (either local or remote). | |
File:: |
public | property | The file UUID. | |
File:: |
public | function |
Overrides Drupal\Core\Entity\Entity::id(). Overrides Entity:: |