[TYPO3-mvc] Nearly completly confused

Sebastian Fischer typo3 at evoweb.de
Mon Feb 21 21:56:51 CET 2011


On 21.02.2011 17:57, Thomas "Thasmo" Deinhamer wrote:
> Sebastian Fischer wrote:
>> How am i supposed to override the storagePid from controller indexAction?
>
> Not exactly sure what you mean, I also didn't
> use Extbase for backend modules yet.
>
> You can, when saving objects, define the storagePid via
> $object->setPid(15).
>
> For reading objects, you could just disable the storagePid
> in your repository, either create a custom method inside the
> repository or completely disable it in the repository:
>
> class Tx_Hype_Domain_Repository_Typo3_PageRepository extends
> Tx_Extbase_Persistence_Repository {
> public function createQuery() {
> $query = parent::createQuery($this->objectType);
> $query->getQuerySettings()->setRespectStoragePage(FALSE);
> return $query;
> }
> }
>
> Regards,
> Thomas

Hi Thomas,

setRespectStoragePage works good for querying. But setPid doesnt work at 
all. In the method 
Tx_Extbase_Persistence_Backend::addCommonFieldsToRow() the pid gets 
overwritten everytime i add add an object. So that is not working.

Greetings
Sebastian


More information about the TYPO3-project-typo3v4mvc mailing list