PHP Класс Neos\Media\Domain\Service\AssetService

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$packageManager Neos\Flow\Package\PackageManagerInterface
$reflectionService Neos\Flow\Reflection\ReflectionService
$resourceManager Neos\Flow\ResourceManagement\ResourceManager
$thumbnailService ThumbnailService
$uriBuilder Neos\Flow\Mvc\Routing\UriBuilder
$usageStrategies array

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

Метод Описание
emitAssetCreated ( Neos\Media\Domain\Model\AssetInterface $asset ) : void Signals that an asset was added.
emitAssetRemoved ( Neos\Media\Domain\Model\AssetInterface $asset ) : void Signals that an asset was removed.
emitAssetResourceReplaced ( Neos\Media\Domain\Model\AssetInterface $asset ) : void Signals that a resource on an asset has been replaced
emitAssetUpdated ( Neos\Media\Domain\Model\AssetInterface $asset ) : void Signals that an asset was updated.
getRepository ( Neos\Media\Domain\Model\AssetInterface $asset ) : Neos\Flow\Persistence\RepositoryInterface Returns the repository for an asset
getThumbnailUriAndSizeForAsset ( Neos\Media\Domain\Model\AssetInterface $asset, ThumbnailConfiguration $configuration, ActionRequest $request = null ) : array | null Calculates the dimensions of the thumbnail to be generated and returns the thumbnail URI.
getUsageCount ( Neos\Media\Domain\Model\AssetInterface $asset ) : integer Returns the total count of times an asset is used.
getUsageReferences ( Neos\Media\Domain\Model\AssetInterface $asset ) : array<\Neos\Media\Domain\Model\Dto\UsageReference> Returns an array of asset usage references.
isInUse ( Neos\Media\Domain\Model\AssetInterface $asset ) : boolean Returns true if the asset is used.
replaceAssetResource ( Neos\Media\Domain\Model\AssetInterface $asset, PersistentResource $resource, array $options = [] ) : void Replace resource on an asset. Takes variants and redirect handling into account.
validateRemoval ( Neos\Media\Domain\Model\AssetInterface $asset ) : void Validates if the asset can be removed

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

Метод Описание
getUsageStrategies ( ) : array<\Neos\Media\Domain\Strategy\AssetUsageStrategyInterface> Returns all registered asset usage strategies

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

emitAssetCreated() публичный Метод

Signals that an asset was added.
public emitAssetCreated ( Neos\Media\Domain\Model\AssetInterface $asset ) : void
$asset Neos\Media\Domain\Model\AssetInterface
Результат void

emitAssetRemoved() публичный Метод

Signals that an asset was removed.
public emitAssetRemoved ( Neos\Media\Domain\Model\AssetInterface $asset ) : void
$asset Neos\Media\Domain\Model\AssetInterface
Результат void

emitAssetResourceReplaced() публичный Метод

Signals that a resource on an asset has been replaced
public emitAssetResourceReplaced ( Neos\Media\Domain\Model\AssetInterface $asset ) : void
$asset Neos\Media\Domain\Model\AssetInterface
Результат void

emitAssetUpdated() публичный Метод

Signals that an asset was updated.
public emitAssetUpdated ( Neos\Media\Domain\Model\AssetInterface $asset ) : void
$asset Neos\Media\Domain\Model\AssetInterface
Результат void

getRepository() публичный Метод

Returns the repository for an asset
public getRepository ( Neos\Media\Domain\Model\AssetInterface $asset ) : Neos\Flow\Persistence\RepositoryInterface
$asset Neos\Media\Domain\Model\AssetInterface
Результат Neos\Flow\Persistence\RepositoryInterface

getThumbnailUriAndSizeForAsset() публичный Метод

In case of Images this is a thumbnail of the image, in case of other assets an icon representation.
public getThumbnailUriAndSizeForAsset ( Neos\Media\Domain\Model\AssetInterface $asset, ThumbnailConfiguration $configuration, ActionRequest $request = null ) : array | null
$asset Neos\Media\Domain\Model\AssetInterface
$configuration Neos\Media\Domain\Model\ThumbnailConfiguration
$request Neos\Flow\Mvc\ActionRequest Request argument must be provided for asynchronous thumbnails
Результат array | null Array with keys "width", "height" and "src" if the thumbnail generation work or null

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

Returns the total count of times an asset is used.
public getUsageCount ( Neos\Media\Domain\Model\AssetInterface $asset ) : integer
$asset Neos\Media\Domain\Model\AssetInterface
Результат integer

getUsageReferences() публичный Метод

Returns an array of asset usage references.
public getUsageReferences ( Neos\Media\Domain\Model\AssetInterface $asset ) : array<\Neos\Media\Domain\Model\Dto\UsageReference>
$asset Neos\Media\Domain\Model\AssetInterface
Результат array<\Neos\Media\Domain\Model\Dto\UsageReference>

getUsageStrategies() защищенный Метод

Returns all registered asset usage strategies
protected getUsageStrategies ( ) : array<\Neos\Media\Domain\Strategy\AssetUsageStrategyInterface>
Результат array<\Neos\Media\Domain\Strategy\AssetUsageStrategyInterface>

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

Returns true if the asset is used.
public isInUse ( Neos\Media\Domain\Model\AssetInterface $asset ) : boolean
$asset Neos\Media\Domain\Model\AssetInterface
Результат boolean

replaceAssetResource() публичный Метод

Replace resource on an asset. Takes variants and redirect handling into account.
public replaceAssetResource ( Neos\Media\Domain\Model\AssetInterface $asset, PersistentResource $resource, array $options = [] ) : void
$asset Neos\Media\Domain\Model\AssetInterface
$resource Neos\Flow\ResourceManagement\PersistentResource
$options array
Результат void

validateRemoval() публичный Метод

Validates if the asset can be removed
public validateRemoval ( Neos\Media\Domain\Model\AssetInterface $asset ) : void
$asset Neos\Media\Domain\Model\AssetInterface
Результат void

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

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

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
Результат Neos\Flow\ObjectManagement\ObjectManagerInterface

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

protected PackageManagerInterface,Neos\Flow\Package $packageManager
Результат Neos\Flow\Package\PackageManagerInterface

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

protected ReflectionService,Neos\Flow\Reflection $reflectionService
Результат Neos\Flow\Reflection\ReflectionService

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

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

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

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

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

protected UriBuilder,Neos\Flow\Mvc\Routing $uriBuilder
Результат Neos\Flow\Mvc\Routing\UriBuilder

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

protected array $usageStrategies
Результат array