PHP Класс Neos\Media\Domain\Model\Asset

It can be used as is to represent any asset for which no better match is available.
Наследование: implements Neos\Media\Domain\Model\AssetInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$assetCollections Collection<\Neos\Media\Domain\Model\AssetCollection>
$assetRepository Neos\Media\Domain\Repository\AssetRepository
$assetService Neos\Media\Domain\Service\AssetService
$caption string
$lastModified DateTime
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$resource Neos\Flow\ResourceManagement\PersistentResource
$resourceManager Neos\Flow\ResourceManagement\ResourceManager
$systemLogger Neos\Flow\Log\SystemLoggerInterface
$tags Collection<\Neos\Media\Domain\Model\Tag>
$thumbnailService Neos\Media\Domain\Service\ThumbnailService
$thumbnails Collection<\Neos\Media\Domain\Model\Thumbnail>
$title string

Открытые методы

Метод Описание
__construct ( PersistentResource $resource ) Constructs an asset. The resource is set internally and then initialize() is called.
addTag ( Tag $tag ) : boolean Add a single tag to this asset
addThumbnail ( Thumbnail $thumbnail ) : void An internal method which adds a thumbnail which was generated by the ThumbnailService.
getAssetCollections ( ) : Doctrine\Common\Collections\Collection Return the asset collections this asset is included in
getCaption ( ) : string The caption of this asset
getFileExtension ( ) : string Returns a file extension fitting to the media type of this asset
getIdentifier ( ) : string
getLabel ( ) : string
getLastModified ( ) : DateTime Returns the last modification timestamp for this asset
getMediaType ( ) : string Returns the IANA media type of this asset
getResource ( ) : PersistentResource PersistentResource of the original file
getTags ( ) : Doctrine\Common\Collections\Collection Return the tags assigned to this asset
getThumbnail ( integer $maximumWidth = null, integer $maximumHeight = null, string $ratioMode = ImageInterface::RATIOMODE_INSET, boolean $allowUpScaling = null ) : Thumbnail Returns a thumbnail of this asset
getTitle ( ) : string The title of this image
getUsageCount ( ) : integer Returns the number of times the asset is in use.
initializeObject ( integer $initializationCause ) : void
isInUse ( ) : boolean Returns true if the asset is still in use.
refresh ( ) : void Refreshes this asset after the Resource or any other parameters affecting thumbnails have been modified
removeTag ( Tag $tag ) : boolean Remove a single tag from this asset
setAssetCollections ( Doctrine\Common\Collections\Collection $assetCollections ) : void Set the asset collections that include this asset
setCaption ( string $caption ) : void Sets the caption of this asset (optional)
setResource ( PersistentResource $resource ) : void Sets the asset resource and (re-)initializes the asset.
setTags ( Doctrine\Common\Collections\Collection $tags ) : void Set the tags assigned to this asset
setTitle ( string $title ) : void Sets the title of this image (optional)

Защищенные методы

Метод Описание
emitAssetCreated ( Neos\Media\Domain\Model\AssetInterface $asset ) : void Signals that an asset was created.
initialize ( ) : void Override this to initialize upon instantiation.

Описание методов

__construct() публичный метод

Constructs an asset. The resource is set internally and then initialize() is called.
public __construct ( PersistentResource $resource )
$resource Neos\Flow\ResourceManagement\PersistentResource

addTag() публичный метод

Add a single tag to this asset
public addTag ( Tag $tag ) : boolean
$tag Tag The tag to add
Результат boolean TRUE if the tag added was new, FALSE if it already existed

addThumbnail() публичный метод

An internal method which adds a thumbnail which was generated by the ThumbnailService.
См. также: getThumbnail()
public addThumbnail ( Thumbnail $thumbnail ) : void
$thumbnail Thumbnail
Результат void

emitAssetCreated() защищенный метод

Signals that an asset was created.
Устаревший: Will be removed with next major version of Neos.Media. Use AssetService::emitAssetCreated signal instead.
protected emitAssetCreated ( Neos\Media\Domain\Model\AssetInterface $asset ) : void
$asset Neos\Media\Domain\Model\AssetInterface
Результат void

getAssetCollections() публичный метод

Return the asset collections this asset is included in
public getAssetCollections ( ) : Doctrine\Common\Collections\Collection
Результат Doctrine\Common\Collections\Collection

getCaption() публичный метод

The caption of this asset
public getCaption ( ) : string
Результат string

getFileExtension() публичный метод

Returns a file extension fitting to the media type of this asset
public getFileExtension ( ) : string
Результат string

getIdentifier() публичный метод

public getIdentifier ( ) : string
Результат string

getLabel() публичный метод

public getLabel ( ) : string
Результат string

getLastModified() публичный метод

Returns the last modification timestamp for this asset
public getLastModified ( ) : DateTime
Результат DateTime The date and time of last modification.

getMediaType() публичный метод

Returns the IANA media type of this asset
public getMediaType ( ) : string
Результат string

getResource() публичный метод

PersistentResource of the original file
public getResource ( ) : PersistentResource
Результат Neos\Flow\ResourceManagement\PersistentResource

getTags() публичный метод

Return the tags assigned to this asset
public getTags ( ) : Doctrine\Common\Collections\Collection
Результат Doctrine\Common\Collections\Collection

getThumbnail() публичный метод

If the maximum width / height is not specified or exceeds the original asset's dimensions, the width / height of the original asset is used.
public getThumbnail ( integer $maximumWidth = null, integer $maximumHeight = null, string $ratioMode = ImageInterface::RATIOMODE_INSET, boolean $allowUpScaling = null ) : Thumbnail
$maximumWidth integer The thumbnail's maximum width in pixels
$maximumHeight integer The thumbnail's maximum height in pixels
$ratioMode string Whether the resulting image should be cropped if both edge's sizes are supplied that would hurt the aspect ratio
$allowUpScaling boolean Whether the resulting image should be upscaled
Результат Thumbnail

getTitle() публичный метод

The title of this image
public getTitle ( ) : string
Результат string

getUsageCount() публичный метод

Returns the number of times the asset is in use.
public getUsageCount ( ) : integer
Результат integer

initialize() защищенный метод

Override this to initialize upon instantiation.
protected initialize ( ) : void
Результат void

initializeObject() публичный метод

public initializeObject ( integer $initializationCause ) : void
$initializationCause integer
Результат void

isInUse() публичный метод

Returns true if the asset is still in use.
public isInUse ( ) : boolean
Результат boolean

refresh() публичный метод

Refreshes this asset after the Resource or any other parameters affecting thumbnails have been modified
public refresh ( ) : void
Результат void

removeTag() публичный метод

Remove a single tag from this asset
public removeTag ( Tag $tag ) : boolean
$tag Tag
Результат boolean

setAssetCollections() публичный метод

Set the asset collections that include this asset
public setAssetCollections ( Doctrine\Common\Collections\Collection $assetCollections ) : void
$assetCollections Doctrine\Common\Collections\Collection
Результат void

setCaption() публичный метод

Sets the caption of this asset (optional)
public setCaption ( string $caption ) : void
$caption string
Результат void

setResource() публичный метод

Sets the asset resource and (re-)initializes the asset.
public setResource ( PersistentResource $resource ) : void
$resource Neos\Flow\ResourceManagement\PersistentResource
Результат void

setTags() публичный метод

Set the tags assigned to this asset
public setTags ( Doctrine\Common\Collections\Collection $tags ) : void
$tags Doctrine\Common\Collections\Collection
Результат void

setTitle() публичный метод

Sets the title of this image (optional)
public setTitle ( string $title ) : void
$title string
Результат void

Описание свойств

$assetCollections защищенное свойство

protected Collection<\Neos\Media\Domain\Model\AssetCollection> $assetCollections
Результат Collection<\Neos\Media\Domain\Model\AssetCollection>

$assetRepository защищенное свойство

protected AssetRepository,Neos\Media\Domain\Repository $assetRepository
Результат Neos\Media\Domain\Repository\AssetRepository

$assetService защищенное свойство

protected AssetService,Neos\Media\Domain\Service $assetService
Результат Neos\Media\Domain\Service\AssetService

$caption защищенное свойство

protected string $caption
Результат string

$lastModified защищенное свойство

protected DateTime $lastModified
Результат DateTime

$persistenceManager защищенное свойство

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
Результат Neos\Flow\Persistence\PersistenceManagerInterface

$resource защищенное свойство

protected PersistentResource,Neos\Flow\ResourceManagement $resource
Результат Neos\Flow\ResourceManagement\PersistentResource

$resourceManager защищенное свойство

protected ResourceManager,Neos\Flow\ResourceManagement $resourceManager
Результат Neos\Flow\ResourceManagement\ResourceManager

$systemLogger защищенное свойство

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
Результат Neos\Flow\Log\SystemLoggerInterface

$tags защищенное свойство

protected Collection<\Neos\Media\Domain\Model\Tag> $tags
Результат Collection<\Neos\Media\Domain\Model\Tag>

$thumbnailService защищенное свойство

protected ThumbnailService,Neos\Media\Domain\Service $thumbnailService
Результат Neos\Media\Domain\Service\ThumbnailService

$thumbnails защищенное свойство

protected Collection<\Neos\Media\Domain\Model\Thumbnail> $thumbnails
Результат Collection<\Neos\Media\Domain\Model\Thumbnail>

$title защищенное свойство

protected string $title
Результат string