interface AssetInterface implements ResourceBasedInterface, ThumbnailSupportInterface, AssetSourceAwareInterface (View source)

A user-managed Asset which is stored in the Asset Repository

Methods

PersistentResource
getResource()

Returns the resource of this asset

void
refresh()

Refreshes this asset after the PersistentResource has been modified

getThumbnail(int $maximumWidth = null, int $maximumHeight = null, string $ratioMode = ImageInterface::RATIOMODE_INSET, bool $allowUpScaling = null)

Returns a thumbnail of this model

mixed
addThumbnail(Thumbnail $thumbnail)

Adds a thumbnail which was generated by the ThumbnailService.

void
setAssetSourceIdentifier(string $assetSourceIdentifier)

No description

string|null
getAssetSourceIdentifier()

No description

AssetProxyInterface|null
getAssetProxy()

No description

string
getTitle()

The title of this asset

void
setTitle(string $title)

Sets the title of this asset

void
setResource(PersistentResource $resource)

Sets the resource and possibly triggers a refresh of dependent behavior

string
getMediaType()

Returns the IANA media type of this asset

string
getFileExtension()

Returns a file extension fitting to the media type of this asset

Details

PersistentResource getResource()

Returns the resource of this asset

Return Value

PersistentResource

void refresh()

Refreshes this asset after the PersistentResource has been modified

Return Value

void

Thumbnail getThumbnail(int $maximumWidth = null, int $maximumHeight = null, string $ratioMode = ImageInterface::RATIOMODE_INSET, bool $allowUpScaling = null)

Returns a thumbnail of this model

If the maximum width / height is not specified or exceeds the original asset's dimensions, the width / height of the original asset is used.

Parameters

int $maximumWidth

The thumbnail's maximum width in pixels

int $maximumHeight

The thumbnail's maximum height in pixels

string $ratioMode

Whether the resulting image should be cropped if both edge's sizes are supplied that would hurt the aspect ratio

bool $allowUpScaling

Whether the resulting image should be upscaled

Return Value

Thumbnail

mixed addThumbnail(Thumbnail $thumbnail)

Adds a thumbnail which was generated by the ThumbnailService.

Parameters

Thumbnail $thumbnail

Return Value

mixed

See also

getThumbnail()

void setAssetSourceIdentifier(string $assetSourceIdentifier)

No description

Parameters

string $assetSourceIdentifier

Return Value

void

string|null getAssetSourceIdentifier()

No description

Return Value

string|null

AssetProxyInterface|null getAssetProxy()

No description

Return Value

AssetProxyInterface|null

string getTitle()

The title of this asset

Return Value

string

Title of the asset

void setTitle(string $title)

Sets the title of this asset

Parameters

string $title

Return Value

void

void setResource(PersistentResource $resource)

Sets the resource and possibly triggers a refresh of dependent behavior

Parameters

PersistentResource $resource

Return Value

void

string getMediaType()

Returns the IANA media type of this asset

Return Value

string

string getFileExtension()

Returns a file extension fitting to the media type of this asset

Return Value

string