abstract class EntityShareMediasFileAbstract in Entity Share 7
Abstract Class for medias.
Hierarchy
- class \EntityShareMediasAbstract
- class \EntityShareMediasProviderAbstract implements EntityShareMediasProviderInterface
Expanded class hierarchy of EntityShareMediasFileAbstract
File
- modules/
entity_share_medias/ modules/ entity_share_medias_file/ includes/ entity_share_medias_file.abstract.inc, line 11 - Class for handling file Medias in RTE.
View source
abstract class EntityShareMediasFileAbstract extends EntityShareMediasProviderAbstract {
const CUSTOM_UUID_PREFIX = 'entity_share-';
/**
* Types of field handled by the current class.
*
* @var array
* Type of field types managed.
*/
protected $managedFieldTypes = array(
'file',
);
/**
* Get a file Id from a UUID.
*
* @param string $uuid
* UUID of the file.
*
* @return mixed
* The fileId.
*/
public function getFileIdFromUuid($uuid) {
$file = entity_uuid_load('file', array(
$uuid,
));
$file = current($file) ? current($file) : NULL;
return $file->fid;
}
/**
* Return file uuid.
*
* @param object $file
* The file object.
*
* @return string
* The file UUID.
*/
public function getUuid($file) {
return $file->uuid;
}
}