PHP Class Neos\Media\Domain\Service\AssetService

Afficher le fichier Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$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

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
getUsageStrategies ( ) : array<\Neos\Media\Domain\Strategy\AssetUsageStrategyInterface> Returns all registered asset usage strategies

Method Details

emitAssetCreated() public méthode

Signals that an asset was added.
public emitAssetCreated ( Neos\Media\Domain\Model\AssetInterface $asset ) : void
$asset Neos\Media\Domain\Model\AssetInterface
Résultat void

emitAssetRemoved() public méthode

Signals that an asset was removed.
public emitAssetRemoved ( Neos\Media\Domain\Model\AssetInterface $asset ) : void
$asset Neos\Media\Domain\Model\AssetInterface
Résultat void

emitAssetResourceReplaced() public méthode

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
Résultat void

emitAssetUpdated() public méthode

Signals that an asset was updated.
public emitAssetUpdated ( Neos\Media\Domain\Model\AssetInterface $asset ) : void
$asset Neos\Media\Domain\Model\AssetInterface
Résultat void

getRepository() public méthode

Returns the repository for an asset
public getRepository ( Neos\Media\Domain\Model\AssetInterface $asset ) : Neos\Flow\Persistence\RepositoryInterface
$asset Neos\Media\Domain\Model\AssetInterface
Résultat Neos\Flow\Persistence\RepositoryInterface

getThumbnailUriAndSizeForAsset() public méthode

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
Résultat array | null Array with keys "width", "height" and "src" if the thumbnail generation work or null

getUsageCount() public méthode

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
Résultat integer

getUsageReferences() public méthode

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
Résultat array<\Neos\Media\Domain\Model\Dto\UsageReference>

getUsageStrategies() protected méthode

Returns all registered asset usage strategies
protected getUsageStrategies ( ) : array<\Neos\Media\Domain\Strategy\AssetUsageStrategyInterface>
Résultat array<\Neos\Media\Domain\Strategy\AssetUsageStrategyInterface>

isInUse() public méthode

Returns true if the asset is used.
public isInUse ( Neos\Media\Domain\Model\AssetInterface $asset ) : boolean
$asset Neos\Media\Domain\Model\AssetInterface
Résultat boolean

replaceAssetResource() public méthode

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
Résultat void

validateRemoval() public méthode

Validates if the asset can be removed
public validateRemoval ( Neos\Media\Domain\Model\AssetInterface $asset ) : void
$asset Neos\Media\Domain\Model\AssetInterface
Résultat void

Property Details

$objectManager protected_oe property

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
Résultat Neos\Flow\ObjectManagement\ObjectManagerInterface

$packageManager protected_oe property

protected PackageManagerInterface,Neos\Flow\Package $packageManager
Résultat Neos\Flow\Package\PackageManagerInterface

$reflectionService protected_oe property

protected ReflectionService,Neos\Flow\Reflection $reflectionService
Résultat Neos\Flow\Reflection\ReflectionService

$resourceManager protected_oe property

protected ResourceManager,Neos\Flow\ResourceManagement $resourceManager
Résultat Neos\Flow\ResourceManagement\ResourceManager

$thumbnailService protected_oe property

protected ThumbnailService,Neos\Media\Domain\Service $thumbnailService
Résultat ThumbnailService

$uriBuilder protected_oe property

protected UriBuilder,Neos\Flow\Mvc\Routing $uriBuilder
Résultat Neos\Flow\Mvc\Routing\UriBuilder

$usageStrategies protected_oe property

protected array $usageStrategies
Résultat array