Asset
class Asset implements AssetInterface (View source)
An Asset, the base for all more specific assets in this package.
It can be used as is to represent any asset for which no better match is available.
Properties
protected PersistenceManagerInterface | $persistenceManager | ||
protected LoggerInterface | $systemLogger | ||
protected ResourceManager | $resourceManager | ||
protected ThumbnailService | $thumbnailService | ||
protected AssetService | $assetService | ||
protected AssetRepository | $assetRepository | ||
protected ImportedAssetRepository | $importedAssetRepository | ||
protected DateTime | $lastModified | ||
protected string | $title | ||
protected string | $caption | ||
protected string | $copyrightNotice | ||
protected PersistentResource | $resource | ||
protected Thumbnail> | $thumbnails | ||
protected Tag> | $tags | ||
protected AssetCollection> | $assetCollections | ||
string | $assetSourceIdentifier | ||
protected array | $assetSourcesConfiguration | ||
protected AssetSourceInterface[] | $assetSources |
Methods
Constructs an asset. The resource is set internally and then initialize() is called.
No description
Override this to initialize upon instantiation.
No description
No description
Returns the last modification timestamp for this asset
Sets the asset resource and (re-)initializes the asset.
PersistentResource of the original file
Returns a file extension fitting to the media type of this asset
Returns the IANA media type of this asset
Sets the title of this image (optional)
The title of this image
Sets the caption of this asset (optional)
The caption of this asset
No description
No description
Return the tags assigned to this asset
Returns a thumbnail of this asset
An internal method which adds a thumbnail which was generated by the ThumbnailService.
Refreshes this asset after the Resource or any other parameters affecting thumbnails have been modified
Set the tags assigned to this asset
Return the asset collections this asset is included in
Set the asset collections that include this asset
Set the asset source identifier for this asset
No description
No description
Returns true if the asset is still in use.
Returns the number of times the asset is in use.
Details
__construct(PersistentResource $resource)
Constructs an asset. The resource is set internally and then initialize() is called.
void
initializeObject(int $initializationCause)
No description
protected void
initialize()
Override this to initialize upon instantiation.
string
getIdentifier()
No description
string
getLabel()
No description
DateTime
getLastModified()
Returns the last modification timestamp for this asset
void
setResource(PersistentResource $resource)
Sets the asset resource and (re-)initializes the asset.
PersistentResource
getResource()
PersistentResource of the original file
string
getFileExtension()
Returns a file extension fitting to the media type of this asset
string
getMediaType()
Returns the IANA media type of this asset
void
setTitle(string $title)
Sets the title of this image (optional)
string
getTitle()
The title of this image
void
setCaption(string $caption)
Sets the caption of this asset (optional)
string
getCaption()
The caption of this asset
string
getCopyrightNotice()
No description
void
setCopyrightNotice(string $copyrightNotice)
No description
Collection
getTags()
Return the tags assigned to this asset
bool
addTag(Tag $tag)
Add a single tag to this asset
Thumbnail
getThumbnail(int $maximumWidth = null, int $maximumHeight = null, string $ratioMode = ImageInterface::RATIOMODE_INSET, bool $allowUpScaling = null)
Returns a thumbnail of this asset
If the maximum width / height is not specified or exceeds the original asset's dimensions, the width / height of the original asset is used.
mixed
addThumbnail(Thumbnail $thumbnail)
An internal method which adds a thumbnail which was generated by the ThumbnailService.
void
refresh()
Refreshes this asset after the Resource or any other parameters affecting thumbnails have been modified
void
setTags(Collection $tags)
Set the tags assigned to this asset
bool
removeTag(Tag $tag)
Remove a single tag from this asset
Collection
getAssetCollections()
Return the asset collections this asset is included in
void
setAssetCollections(Collection $assetCollections)
Set the asset collections that include this asset
void
setAssetSourceIdentifier(string $assetSourceIdentifier)
Set the asset source identifier for this asset
This is an internal method which allows Neos / Flow to keep track of assets which were imported from external asset sources.
string|null
getAssetSourceIdentifier()
No description
AssetProxyInterface|null
getAssetProxy()
No description
bool
isInUse()
Returns true if the asset is still in use.
int
getUsageCount()
Returns the number of times the asset is in use.