registerReconstitutedEntity() public method

$entityData format is described in "Documentation/PersistenceFramework object data format.txt"
public registerReconstitutedEntity ( object $entity, array $entityData ) : void
$entity object
$entityData array
return void
 /**
  * @test
  */
 public function unregisterReconstitutedEntityRemovesObjectFromSession()
 {
     $someObject = new \ArrayObject([]);
     $session = new Persistence\Generic\Session();
     $session->registerObject($someObject, 'fakeUuid');
     $session->registerReconstitutedEntity($someObject, ['identifier' => 'fakeUuid']);
     $session->unregisterReconstitutedEntity($someObject);
     $ReconstitutedEntities = $session->getReconstitutedEntities();
     $this->assertFalse($ReconstitutedEntities->contains($someObject));
 }
 /**
  * Stores or updates an object in the underlying storage.
  *
  * @param object $object The object to persist
  * @param string $parentIdentifier
  * @return string
  * @api
  */
 protected function persistObject($object, $parentIdentifier)
 {
     if (isset($this->visitedDuringPersistence[$object])) {
         return $this->visitedDuringPersistence[$object];
     }
     $identifier = $this->persistenceSession->getIdentifierByObject($object);
     $this->visitedDuringPersistence[$object] = $identifier;
     $objectData = [];
     $objectState = $this->storeObject($object, $identifier, $parentIdentifier, $objectData);
     if ($this->reflectionService->getClassSchema($object)->getModelType() === ClassSchema::MODELTYPE_ENTITY) {
         $this->persistenceSession->registerReconstitutedEntity($object, $objectData);
     }
     $this->emitPersistedObject($object, $objectState);
     return $identifier;
 }
 /**
  * Maps a single record into the object it represents and registers it as
  * reconstituted with the session.
  *
  * @param array $objectData
  * @return object
  * @throws Exception\InvalidObjectDataException
  * @throws PersistenceException
  */
 public function mapToObject(array $objectData)
 {
     if ($objectData === []) {
         throw new Exception\InvalidObjectDataException('The array with object data was empty, probably object not found or access denied.', 1277974338);
     }
     if ($this->persistenceSession->hasIdentifier($objectData['identifier'])) {
         return $this->persistenceSession->getObjectByIdentifier($objectData['identifier']);
     } else {
         $className = $objectData['classname'];
         $classSchema = $this->reflectionService->getClassSchema($className);
         $object = unserialize('O:' . strlen($className) . ':"' . $className . '":0:{};');
         $this->persistenceSession->registerObject($object, $objectData['identifier']);
         if ($classSchema->getModelType() === ClassSchema::MODELTYPE_ENTITY) {
             $this->persistenceSession->registerReconstitutedEntity($object, $objectData);
         }
         if ($objectData['properties'] === []) {
             if (!$classSchema->isLazyLoadableObject()) {
                 throw new PersistenceException('The object of type "' . $className . '" is not marked as lazy loadable.', 1268309017);
             }
             $persistenceManager = $this->persistenceManager;
             $persistenceSession = $this->persistenceSession;
             $dataMapper = $this;
             $identifier = $objectData['identifier'];
             $modelType = $classSchema->getModelType();
             $object->Flow_Persistence_LazyLoadingObject_thawProperties = function ($object) use($persistenceManager, $persistenceSession, $dataMapper, $identifier, $modelType) {
                 $objectData = $persistenceManager->getObjectDataByIdentifier($identifier);
                 $dataMapper->thawProperties($object, $identifier, $objectData);
                 if ($modelType === ClassSchema::MODELTYPE_ENTITY) {
                     $persistenceSession->registerReconstitutedEntity($object, $objectData);
                 }
             };
         } else {
             $this->thawProperties($object, $objectData['identifier'], $objectData);
         }
         return $object;
     }
 }