PHP Класс Neos\Media\TypeConverter\AssetInterfaceConverter

Наследование: extends Neos\Flow\Property\TypeConverter\PersistentObjectConverter
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$assetModelMappingStrategy Neos\Media\Domain\Strategy\AssetModelMappingStrategyInterface
$assetRepository Neos\Media\Domain\Repository\AssetRepository
$defaultNewAssetType string If creating a new asset from this converter this defines the default type as fallback.
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$priority integer
$resourceManager Neos\Flow\ResourceManagement\ResourceManager
$resourcesAlreadyConvertedToAssets array Maps resource identifiers to assets that already got created during the current request.
$sourceTypes array
$targetType string

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

Метод Описание
canConvertFrom ( mixed $source, string $targetType ) : boolean If $source has an identity, we have a persisted Image, and therefore this type converter should withdraw and let the PersistedObjectConverter kick in.
convertFrom ( mixed $source, string $targetType, array $convertedChildProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : Error | Neos\Media\Domain\Model\AssetInterface Convert an object from $source to an \Neos\Media\Domain\Model\AssetInterface implementation
getSourceChildPropertiesToBeConverted ( mixed $source ) : array All properties in the source array except __identity and adjustments are sub-properties.
getTargetTypeForSource ( mixed $source, string $originalTargetType, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : string Determines the target type based on the source's (optional) __type key.
getTypeOfChildProperty ( string $targetType, string $propertyName, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : string Convert the property "resource"

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

Метод Описание
applyModelMappingStrategy ( string $originalTargetType, PersistentResource $resource, array $source = [] ) : string Applies the model mapping strategy for a converted resource to determine the final target type.
applyTypeSpecificHandling ( Neos\Media\Domain\Model\AssetInterface $asset, mixed $source, array $convertedChildProperties, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : Neos\Media\Domain\Model\AssetInterface | null
buildObject ( array &$possibleConstructorArgumentValues, string $objectType ) : object Builds a new instance of $objectType with the given $possibleConstructorArgumentValues.
fetchObjectFromPersistence ( mixed $identity, string $targetType ) : object Fetch an object from persistence layer.

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

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

The strategy is NOT applied if $source['__type'] is set (overriding was allowed then, otherwise an exception would have been thrown earlier).
protected applyModelMappingStrategy ( string $originalTargetType, PersistentResource $resource, array $source = [] ) : string
$originalTargetType string The original target type determined so far
$resource Neos\Flow\ResourceManagement\PersistentResource The resource that is to be converted to a media file.
$source array the original source properties for this type converter.
Результат string Class name of the media model to use for the given resource

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

protected applyTypeSpecificHandling ( Neos\Media\Domain\Model\AssetInterface $asset, mixed $source, array $convertedChildProperties, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : Neos\Media\Domain\Model\AssetInterface | null
$asset Neos\Media\Domain\Model\AssetInterface
$source mixed
$convertedChildProperties array
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
Результат Neos\Media\Domain\Model\AssetInterface | null

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

If constructor argument values are missing from the given array the method looks for a default value in the constructor signature. Furthermore, the constructor arguments are removed from $possibleConstructorArgumentValues
protected buildObject ( array &$possibleConstructorArgumentValues, string $objectType ) : object
$possibleConstructorArgumentValues array
$objectType string
Результат object The created instance

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

If $source has an identity, we have a persisted Image, and therefore this type converter should withdraw and let the PersistedObjectConverter kick in.
public canConvertFrom ( mixed $source, string $targetType ) : boolean
$source mixed The source for the to-build Image
$targetType string Should always be 'Neos\Media\Domain\Model\ImageInterface'
Результат boolean

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

Convert an object from $source to an \Neos\Media\Domain\Model\AssetInterface implementation
public convertFrom ( mixed $source, string $targetType, array $convertedChildProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : Error | Neos\Media\Domain\Model\AssetInterface
$source mixed
$targetType string must implement 'Neos\Media\Domain\Model\AssetInterface'
$convertedChildProperties array
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
Результат Neos\Flow\Validation\Error | Neos\Media\Domain\Model\AssetInterface The converted Asset, a Validation Error or NULL

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

Fetch an object from persistence layer.
protected fetchObjectFromPersistence ( mixed $identity, string $targetType ) : object
$identity mixed
$targetType string
Результат object

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

All properties in the source array except __identity and adjustments are sub-properties.
public getSourceChildPropertiesToBeConverted ( mixed $source ) : array
$source mixed
Результат array

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

Determines the target type based on the source's (optional) __type key.
public getTargetTypeForSource ( mixed $source, string $originalTargetType, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : string
$source mixed
$originalTargetType string
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
Результат string

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

Convert the property "resource"
public getTypeOfChildProperty ( string $targetType, string $propertyName, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : string
$targetType string
$propertyName string
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
Результат string

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

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

protected AssetModelMappingStrategyInterface,Neos\Media\Domain\Strategy $assetModelMappingStrategy
Результат Neos\Media\Domain\Strategy\AssetModelMappingStrategyInterface

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

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

$defaultNewAssetType защищенное статическое свойство

If creating a new asset from this converter this defines the default type as fallback.
protected static string $defaultNewAssetType
Результат string

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

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

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

protected int $priority
Результат integer

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

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

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

Maps resource identifiers to assets that already got created during the current request.
protected array $resourcesAlreadyConvertedToAssets
Результат array

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

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

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

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