PHP 클래스 Neos\Flow\Property\TypeConverter\PersistentObjectConverter

- If the input is string, it is assumed to be a UUID. Then, the object is fetched from persistence. - If the input is array, we check if it has an identity property. - If the input has NO identity property, but additional properties, we create a new object and return it. However, we only do this if the configuration option "CONFIGURATION_CREATION_ALLOWED" is TRUE. - If the input has an identity property AND the configuration option "CONFIGURATION_IDENTITY_CREATION_ALLOWED" is set, we fetch the object from persistent or create a new object if none was found and then set the sub-properties. - If the input has an identity property and NO additional properties, we fetch the object from persistence. - If the input has an identity property AND additional properties, we fetch the object from persistence, and set the sub-properties. We only do this if the configuration option "CONFIGURATION_MODIFICATION_ALLOWED" is TRUE.
상속: extends ObjectConverter
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$priority integer
$sourceTypes array

공개 메소드들

메소드 설명
canConvertFrom ( mixed $source, string $targetType ) : boolean We can only convert if the $targetType is either tagged with entity or value object.
convertFrom ( mixed $source, string $targetType, array $convertedChildProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : object | Neos\Flow\Property\TypeConverter\Error\TargetNotFoundError Convert an object from $source to an entity or a value object.
getSourceChildPropertiesToBeConverted ( mixed $source ) : array All properties in the source array except __identity are sub-properties.
getTypeOfChildProperty ( string $targetType, string $propertyName, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : string The type of a property is determined by the reflection service.

보호된 메소드들

메소드 설명
fetchObjectFromPersistence ( mixed $identity, string $targetType ) : object Fetch an object from persistence layer.
findObjectByIdentityProperties ( array $identityProperties, string $type ) : object Finds an object from the repository by searching for its identity properties.
handleArrayData ( array $source, string $targetType, array &$convertedChildProperties, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : object | Neos\Flow\Property\TypeConverter\Error\TargetNotFoundError Handle the case if $source is an array.
setIdentity ( object $object, string | array $identity ) : void Set the given $identity on the created $object.

메소드 상세

canConvertFrom() 공개 메소드

We can only convert if the $targetType is either tagged with entity or value object.
public canConvertFrom ( mixed $source, string $targetType ) : boolean
$source mixed
$targetType string
리턴 boolean

convertFrom() 공개 메소드

Convert an object from $source to an entity or a value object.
public convertFrom ( mixed $source, string $targetType, array $convertedChildProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : object | Neos\Flow\Property\TypeConverter\Error\TargetNotFoundError
$source mixed
$targetType string
$convertedChildProperties array
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
리턴 object | Neos\Flow\Property\TypeConverter\Error\TargetNotFoundError the converted entity/value object or an instance of TargetNotFoundError if the object could not be resolved

fetchObjectFromPersistence() 보호된 메소드

Fetch an object from persistence layer.
protected fetchObjectFromPersistence ( mixed $identity, string $targetType ) : object
$identity mixed
$targetType string
리턴 object

findObjectByIdentityProperties() 보호된 메소드

Finds an object from the repository by searching for its identity properties.
protected findObjectByIdentityProperties ( array $identityProperties, string $type ) : object
$identityProperties array Property names and values to search for
$type string The object type to look for
리턴 object Either the object matching the identity or NULL if no object was found

getSourceChildPropertiesToBeConverted() 공개 메소드

All properties in the source array except __identity are sub-properties.
public getSourceChildPropertiesToBeConverted ( mixed $source ) : array
$source mixed
리턴 array

getTypeOfChildProperty() 공개 메소드

The type of a property is determined by the reflection service.
public getTypeOfChildProperty ( string $targetType, string $propertyName, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration ) : string
$targetType string
$propertyName string
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
리턴 string

handleArrayData() 보호된 메소드

Handle the case if $source is an array.
protected handleArrayData ( array $source, string $targetType, array &$convertedChildProperties, Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : object | Neos\Flow\Property\TypeConverter\Error\TargetNotFoundError
$source array
$targetType string
$convertedChildProperties array
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
리턴 object | Neos\Flow\Property\TypeConverter\Error\TargetNotFoundError

setIdentity() 보호된 메소드

Set the given $identity on the created $object.
protected setIdentity ( object $object, string | array $identity ) : void
$object object
$identity string | array
리턴 void

프로퍼티 상세

$persistenceManager 보호되어 있는 프로퍼티

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
리턴 Neos\Flow\Persistence\PersistenceManagerInterface

$priority 보호되어 있는 프로퍼티

protected int $priority
리턴 integer

$sourceTypes 보호되어 있는 프로퍼티

protected array $sourceTypes
리턴 array