PHP 클래스 Neos\Media\TypeConverter\AssetInterfaceConverter

상속: extends Neos\Flow\Property\TypeConverter\PersistentObjectConverter
파일 보기 프로젝트 열기: neos/neos-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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