RemoteFile.php in File URL 2.0.x
Same filename and directory in other branches
Namespace
Drupal\file_url\EntityFile
src/Entity/RemoteFile.phpView source
<?php
namespace Drupal\file_url\Entity;
use Drupal\file\Entity\File;
/**
* Defines the remote file entity class.
*
* @ingroup file
*
* @ContentEntityType(
* id = "remote_file",
* label = @Translation("Remote file"),
* handlers = {
* "storage" = "Drupal\Core\Entity\ContentEntityNullStorage",
* },
* base_table = "file_managed",
* entity_keys = {
* "id" = "fid",
* "label" = "filename",
* "langcode" = "langcode",
* "owner" = "uid",
* "uuid" = "uuid"
* }
* )
*/
class RemoteFile extends File {
/**
* {@inheritdoc}
*/
public static function load($id) {
return parent::create([
'uri' => $id,
]);
}
/**
* {@inheritdoc}
*/
public function id() {
return $this
->getFileUri();
}
}
Classes
Name | Description |
---|---|
RemoteFile | Defines the remote file entity class. |