PHP Class Neos\Flow\ObjectManagement\ObjectSerializer

Dependant objects are only included if they are not singleton and the property is not annotated transient. Afterwards it can reconstitute the objects from the array.
Show file Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface The object manager
$objectReferences SplObjectStorage
$objectsAsArray array Objects stored as an array of properties
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface The persistence manager
$reconstitutedObjects array
$reflectionService Neos\Flow\Reflection\ReflectionService The reflection service

Public Methods

Method Description
clearState ( ) : void Clears the internal state, discarding all stored objects.
deserializeObjectsArray ( array $dataArray ) : array Deserializes a given object tree and reinjects all dependencies.
injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void Injects the object manager
injectPersistenceManager ( Neos\Flow\Persistence\PersistenceManagerInterface $persistenceManager ) : void Inject the persistence manager
injectReflectionService ( ReflectionService $reflectionService ) : void Injects the reflection service
serializeObjectAsPropertyArray ( object $object, boolean $isTopLevelItem = true ) : array Serializes an object as property array.

Protected Methods

Method Description
buildStorageArrayForArrayProperty ( array $arrayProperty ) : array Builds a storable array out of an array property. It calls itself recursively for multidimensional arrays. For objects putObject() ist called with the object's hash value as $objectName.
reconstituteArray ( array $dataArray ) : array Reconstitutes an array from a data array.
reconstituteCollection ( string $type, array $dataArray ) : Doctrine\Common\Collections\Collection Reconstitutes a Doctrine Collection from a data array.
reconstituteObject ( string $objectHash, array $objectData ) : object Reconstitutes an object from a serialized object without calling the constructor.
reconstitutePersistenceObject ( string $className, string $uuid ) : object Reconstitutes a persistence object (entity or valueobject) identified by the given UUID.
reconstituteSplObjectStorage ( array $dataArray ) : SplObjectStorage Reconstitutes an SplObjectStorage from a data array.

Method Details

buildStorageArrayForArrayProperty() protected method

Builds a storable array out of an array property. It calls itself recursively for multidimensional arrays. For objects putObject() ist called with the object's hash value as $objectName.
protected buildStorageArrayForArrayProperty ( array $arrayProperty ) : array
$arrayProperty array The source array property
return array The array property to store

clearState() public method

Clears the internal state, discarding all stored objects.
public clearState ( ) : void
return void

deserializeObjectsArray() public method

Deserializes a given object tree and reinjects all dependencies.
public deserializeObjectsArray ( array $dataArray ) : array
$dataArray array The serialized objects array
return array The deserialized objects in an array

injectObjectManager() public method

Injects the object manager
public injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface The object manager
return void

injectPersistenceManager() public method

Inject the persistence manager
public injectPersistenceManager ( Neos\Flow\Persistence\PersistenceManagerInterface $persistenceManager ) : void
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface The persistence manager
return void

injectReflectionService() public method

Injects the reflection service
public injectReflectionService ( ReflectionService $reflectionService ) : void
$reflectionService Neos\Flow\Reflection\ReflectionService The reflection service
return void

reconstituteArray() protected method

Reconstitutes an array from a data array.
protected reconstituteArray ( array $dataArray ) : array
$dataArray array The data array to reconstitute from
return array The reconstituted array

reconstituteCollection() protected method

Reconstitutes a Doctrine Collection from a data array.
protected reconstituteCollection ( string $type, array $dataArray ) : Doctrine\Common\Collections\Collection
$type string The collection type (class name) to create
$dataArray array The data array to reconstitute from
return Doctrine\Common\Collections\Collection The reconstituted Collection

reconstituteObject() protected method

Reconstitutes an object from a serialized object without calling the constructor.
protected reconstituteObject ( string $objectHash, array $objectData ) : object
$objectHash string Identifier of the serialized object
$objectData array The object data array
return object

reconstitutePersistenceObject() protected method

Reconstitutes a persistence object (entity or valueobject) identified by the given UUID.
protected reconstitutePersistenceObject ( string $className, string $uuid ) : object
$className string The class name of the object to retrieve
$uuid string The UUID of the object
return object The reconstituted persistence object, NULL if none was found

reconstituteSplObjectStorage() protected method

Reconstitutes an SplObjectStorage from a data array.
protected reconstituteSplObjectStorage ( array $dataArray ) : SplObjectStorage
$dataArray array The data array to reconstitute from
return SplObjectStorage The reconstituted SplObjectStorage

serializeObjectAsPropertyArray() public method

Serializes an object as property array.
public serializeObjectAsPropertyArray ( object $object, boolean $isTopLevelItem = true ) : array
$object object The object to store in the registry
$isTopLevelItem boolean Internal flag for managing the recursion
return array The property array

Property Details

$objectManager protected property

The object manager
protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
return Neos\Flow\ObjectManagement\ObjectManagerInterface

$objectReferences protected property

protected SplObjectStorage $objectReferences
return SplObjectStorage

$objectsAsArray protected property

Objects stored as an array of properties
protected array $objectsAsArray
return array

$persistenceManager protected property

The persistence manager
protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
return Neos\Flow\Persistence\PersistenceManagerInterface

$reconstitutedObjects protected property

protected array $reconstitutedObjects
return array

$reflectionService protected property

The reflection service
protected ReflectionService,Neos\Flow\Reflection $reflectionService
return Neos\Flow\Reflection\ReflectionService