[TYPO3-mvc] storagePid and findObjectByUid

Elías Fernández eliasfernandez at gmail.com
Tue Nov 24 08:58:32 CET 2009


Hello list.
Is really amazing the development speed with extbase and fluid. Cool work¡.
I´m near to end my first extension, and it looks like i was programming  all
my life with extbase+fluid. Very intuitive.

Now i have one suggestion. I think that the storagePid solution will give
troubles, especially when you want to use the magic of property mapping.

In my repository when i want to update an item, always throw
Tx_Extbase_MVC_Exception_InvalidArgumentValue exception, because the mapper
try to use findObjectByUid and it is storagePid dependant.
( The edit page is in another page than the list view )

I didn´t find a way of change setRespectStoragePage via pages.

I think here is not very important the restriction of being in the same pid
or not. Finally, i modify the Mapper class and insert the
setRespectStoragePage to the findObjectByUid

protected function findObjectByUid($dataType, $uid) {
$query = $this->queryFactory->create($dataType);
$query->getQuerySettings()->setRespectStoragePage(FALSE);
$result = $query->matching($query->withUid($uid))->execute();
$object = NULL;
if (count($result) > 0) {
$object = current($result);
}
return $object;
}



This way my ext works ¡

But i know there must be a better solution.

Thanx




-- 
Elías Fernández Velázquez


More information about the TYPO3-project-typo3v4mvc mailing list