FlexMediaTrait uses trait:short
Implements Grav Page content and header manipulation methods.
Table of Contents
Properties
- $_loadMedia : bool
- $_uploads : array<string|int, mixed>
- $media : MediaCollectionInterface|null
Methods
- __debugInfo() : array<string|int, mixed>
- checkMediaFilename() : void
- getFieldSettings() : array<string|int, mixed>|null
- getFlexDirectory() : FlexDirectory
- getMedia() : MediaCollectionInterface
- getMediaField() : MediaCollectionInterface|null
- getMediaFolder() : string|null
- 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.
- getStorageFolder() : string|null
- getStorageKey() : string
- addUpdatedMedia() : void
- buildMediaList() : array<string|int, mixed>
- buildMediaObject() : MediaObject|UploadedMediaObject
- clearMediaCache() : void
- Clear media cache.
- createMedium() : Medium|null
- freeMedia() : void
- getCacheKey() : string
- getMediaCache() : CacheInterface
- getMediaFields() : array<string|int, mixed>
- getUpdatedMedia() : array<string, UploadedFileInterface|array<string|int, mixed>|null>
- offsetLoad_media() : MediaCollectionInterface
- offsetSerialize_media() : null
- parseFileProperty() : array<string|int, mixed>|mixed
- saveUpdatedMedia() : void
- setMedia() : $this
- Sets the associated media collection.
- setUpdatedMedia() : void
Properties
$_loadMedia
protected
bool
$_loadMedia
= true
$_uploads
protected
array<string|int, mixed>
$_uploads
= []
$media
protected
MediaCollectionInterface|null
$media
Methods
__debugInfo()
public
__debugInfo() : array<string|int, mixed>
Attributes
- #[ReturnTypeWillChange]
Return values
array<string|int, mixed>checkMediaFilename()
public
checkMediaFilename(string $filename) : void
Use Media class that implements MediaUploadInterface instead.
Parameters
- $filename : string
getFieldSettings()
public
getFieldSettings(string $field) : array<string|int, mixed>|null
Parameters
- $field : string
Return values
array<string|int, mixed>|nullgetFlexDirectory()
public
abstract getFlexDirectory() : FlexDirectory
Return values
FlexDirectorygetMedia()
public
getMedia() : MediaCollectionInterface
Return values
MediaCollectionInterfacegetMediaField()
public
getMediaField(string $field) : MediaCollectionInterface|null
Parameters
- $field : string
Return values
MediaCollectionInterface|nullgetMediaFolder()
public
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|nullgetStorageFolder()
public
getStorageFolder() : string|null
Return values
string|nullgetStorageKey()
public
abstract getStorageKey() : string
Return values
stringaddUpdatedMedia()
protected
addUpdatedMedia(MediaCollectionInterface $media) : void
Parameters
- $media : MediaCollectionInterface
buildMediaList()
protected
buildMediaList(string|null $field) : array<string|int, mixed>
Parameters
- $field : string|null
Return values
array<string|int, mixed>buildMediaObject()
protected
buildMediaObject(string|null $field, string $filename[, MediaObjectInterface|null $image = null ]) : MediaObject|UploadedMediaObject
Parameters
- $field : string|null
- $filename : string
- $image : MediaObjectInterface|null = null
Return values
MediaObject|UploadedMediaObjectclearMediaCache()
Clear media cache.
protected
clearMediaCache() : void
createMedium()
protected
createMedium(string $uri) : Medium|null
Parameters
- $uri : string
Return values
Medium|nullfreeMedia()
protected
freeMedia() : void
getCacheKey()
protected
abstract getCacheKey() : string
Return values
stringgetMediaCache()
protected
getMediaCache() : CacheInterface
Return values
CacheInterfacegetMediaFields()
protected
getMediaFields() : array<string|int, mixed>
Return values
array<string|int, mixed>getUpdatedMedia()
protected
getUpdatedMedia() : array<string, UploadedFileInterface|array<string|int, mixed>|null>
Return values
array<string, UploadedFileInterface|array<string|int, mixed>|null>offsetLoad_media()
protected
offsetLoad_media() : MediaCollectionInterface
Return values
MediaCollectionInterfaceoffsetSerialize_media()
protected
offsetSerialize_media() : null
Return values
nullparseFileProperty()
protected
parseFileProperty(array<string|int, mixed>|mixed $value[, array<string|int, mixed> $settings = [] ]) : array<string|int, mixed>|mixed
Parameters
- $value : array<string|int, mixed>|mixed
- $settings : array<string|int, mixed> = []
Return values
array<string|int, mixed>|mixedsaveUpdatedMedia()
protected
saveUpdatedMedia() : void
setMedia()
Sets the associated media collection.
protected
setMedia(MediaCollectionInterface|Media $media) : $this
Parameters
- $media : MediaCollectionInterface|Media
-
Representation of associated media.
Return values
$thissetUpdatedMedia()
protected
setUpdatedMedia(array<string|int, mixed> $files) : void
Parameters
- $files : array<string|int, mixed>