MediaTrait
Trait MediaTrait
Table of Contents
Properties
- $_loadMedia : bool
- $media : MediaCollectionInterface|null
Methods
- getMedia() : MediaCollectionInterface|Media
- Gets the associated media collection.
- getMediaFolder() : string|null
- Get filesystem path to the associated media.
- getMediaOrder() : array<string|int, mixed>
- Get display order for the associated media.
- getMediaUri() : string|null
- Get URI ot the associated media. Method will return null if path isn't URI.
- clearMediaCache() : void
- Clear media cache.
- freeMedia() : void
- getCacheKey() : string
- getMediaCache() : CacheInterface
- setMedia() : $this
- Sets the associated media collection.
Properties
$_loadMedia
protected
bool
$_loadMedia
= true
$media
protected
MediaCollectionInterface|null
$media
Methods
getMedia()
Gets the associated media collection.
public
getMedia() : MediaCollectionInterface|Media
Return values
MediaCollectionInterface|Media —Representation of associated media.
getMediaFolder()
Get filesystem path to the associated media.
public
abstract getMediaFolder() : string|null
Return values
string|nullgetMediaOrder()
Get display order for the associated media.
public
getMediaOrder() : array<string|int, mixed>
Return values
array<string|int, mixed> —Empty array means default ordering.
getMediaUri()
Get URI ot the associated media. Method will return null if path isn't URI.
public
getMediaUri() : string|null
Return values
string|nullclearMediaCache()
Clear media cache.
protected
clearMediaCache() : void
freeMedia()
protected
freeMedia() : void
getCacheKey()
protected
abstract getCacheKey() : string
Return values
stringgetMediaCache()
protected
getMediaCache() : CacheInterface
Return values
CacheInterfacesetMedia()
Sets the associated media collection.
protected
setMedia(MediaCollectionInterface|Media $media) : $this
Parameters
- $media : MediaCollectionInterface|Media
-
Representation of associated media.