Example #1
0
 /**
  * @test
  */
 public function objectCanBeUnregisteredAsReconstituted()
 {
     $persistenceSession = new Tx_Extbase_Persistence_Session();
     $entity = $this->getMock('Tx_Extbase_DomainObject_AbstractEntity');
     $persistenceSession->registerReconstitutedObject($entity);
     $persistenceSession->unregisterReconstitutedObject($entity);
     $reconstitutedObjects = $persistenceSession->getReconstitutedObjects();
     $this->assertEquals(0, count($reconstitutedObjects), 'The reconstituted objects storage was not empty.');
 }
Example #2
0
 /**
  * Maps a single row on an object of the given class
  *
  * @param string $className The name of the target class
  * @param array $row A single array with field_name => value pairs
  * @return object An object of the given class
  */
 protected function mapSingleRow($className, array $row)
 {
     if ($this->identityMap->hasIdentifier($row['uid'], $className)) {
         $object = $this->identityMap->getObjectByIdentifier($row['uid'], $className);
     } else {
         $object = $this->createEmptyObject($className);
         $this->identityMap->registerObject($object, $row['uid']);
         $this->thawProperties($object, $row);
         $object->_memorizeCleanState();
         $this->persistenceSession->registerReconstitutedObject($object);
     }
     return $object;
 }