Index: ../../typo3_src/typo3_src-4.7.14/typo3/sysext/extbase/Classes/Persistence/Backend.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- ../../typo3_src/typo3_src-4.7.14/typo3/sysext/extbase/Classes/Persistence/Backend.php (revision ) +++ ../../typo3_src/typo3_src-4.7.14/typo3/sysext/extbase/Classes/Persistence/Backend.php (revision ) @@ -97,7 +97,12 @@ */ protected $signalSlotDispatcher; - /** + /** + * @var Tx_Extbase_Object_ObjectManagerInterface + */ + protected $objectManager; + + /** * Constructs the backend * * @return void @@ -183,7 +188,14 @@ $this->signalSlotDispatcher = $signalSlotDispatcher; } - /** + /** + * @param Tx_Extbase_Object_ObjectManagerInterface $objectManager + */ + public function injectObjectManager( Tx_Extbase_Object_ObjectManagerInterface $objectManager ) { + $this->objectManager = $objectManager; + } + + /** * Returns the repository session * * @return Tx_Extbase_Persistence_Session @@ -283,8 +295,15 @@ if ($this->identityMap->hasIdentifier($identifier, $className)) { return $this->identityMap->getObjectByIdentifier($identifier, $className); } else { + try { + /** @var Tx_Extbase_Persistence_RepositoryInterface $repository */ + $repository = $this->objectManager->get( str_replace( '_Model_', '_Repository_', $className ) . 'Repository' ); + $query = $repository->createQuery(); + } + catch( Tx_Extbase_Object_Container_Exception_UnknownObjectException $e ) { - $query = $this->queryFactory->create($className); - $query->getQuerySettings()->setRespectStoragePage(FALSE); + $query = $this->queryFactory->create($className); + $query->getQuerySettings()->setRespectStoragePage(FALSE); + } return $query->matching( $query->equals('uid', $identifier)) \ No newline at end of file