MediaObject
in package
implements
MediaObjectInterface
Class MediaObject
Table of Contents
Interfaces
- MediaObjectInterface
- Media Object Interface
Properties
- $media : MediaObjectInterface|null
- $object : FlexObjectInterface
- $placeholderImage : string
- $field : string|null
- $filename : string
Methods
- __construct() : mixed
- MediaObject constructor.
- __debugInfo() : array<string|int, string>
- createResponse() : Response
- Create media response.
- exists() : bool
- Returns true if the object exists.
- get() : mixed|null
- getId() : string
- Get identifier's ID.
- getMeta() : array<string|int, mixed>
- Get metadata associated to the media object.
- getType() : string
- Get identifier's type.
- getUrl() : string
- Return URL pointing to the media object.
- jsonSerialize() : array<string|int, mixed>
- create404Response() : Response
- processMediaActions() : MediaObjectInterface
- Process media actions
Properties
$media
public
MediaObjectInterface|null
$media
$object
public
FlexObjectInterface
$object
$placeholderImage
public
static string
$placeholderImage
= 'image://media/thumb.png'
$field
private
string|null
$field
$filename
private
string
$filename
Methods
__construct()
MediaObject constructor.
public
__construct(string|null $field, string $filename, MediaObjectInterface|null $media, FlexObjectInterface $object) : mixed
Parameters
- $field : string|null
- $filename : string
- $media : MediaObjectInterface|null
- $object : FlexObjectInterface
__debugInfo()
public
__debugInfo() : array<string|int, string>
Return values
array<string|int, string>createResponse()
Create media response.
public
createResponse(array<string|int, mixed> $actions) : Response
Parameters
- $actions : array<string|int, mixed>
Return values
Responseexists()
Returns true if the object exists.
public
exists() : bool
Return values
boolget()
public
get(string $field) : mixed|null
Parameters
- $field : string
Return values
mixed|nullgetId()
Get identifier's ID.
public
getId() : string
Return values
stringgetMeta()
Get metadata associated to the media object.
public
getMeta() : array<string|int, mixed>
Return values
array<string|int, mixed>getType()
Get identifier's type.
public
getType() : string
Return values
stringgetUrl()
Return URL pointing to the media object.
public
getUrl() : string
Return values
stringjsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>create404Response()
protected
create404Response(array<string|int, mixed> $actions) : Response
Parameters
- $actions : array<string|int, mixed>
Return values
ResponseprocessMediaActions()
Process media actions
protected
processMediaActions(MediaObjectInterface $medium, array<string|int, mixed> $actions) : MediaObjectInterface
Parameters
- $medium : MediaObjectInterface
- $actions : array<string|int, mixed>