[TYPO3-mvc] Map parameters to Extbase controller action even if record is hidden

Jonas Eberle jonas.eberle at d-mind.de
Thu Dec 11 17:48:13 CET 2014


I have found a quite sleek way:

in the initializeXXXAction() I just fetch the object myself:

         if ( $this->request->hasArgument( 'someModel' ) && 
isset($this->request->getArgument( 'someModel' )['__identity']) ) {
             $someModelUid = $this->request->getArgument( 'someModel' 
)['__identity'];
             $q = $this->someRepository->createQuery();
             $q->getQuerySettings()->setIgnoreEnableFields( true );
             $constraints = $q->equals( 'uid', $someModelUid );
             $someModel = $q->matching( $constraints 
)->execute()->getFirst();

$this->arguments['someModel']->setValue($someModel);
         }

... and that allows me to leave all other actions as they were.
I hope I did not do this too stupid. Especially I am not sure if this 
doubles up the database fetching if Extbase IS able to get the object.

Regards,
Jonas

-- 
Neu: Portal Region Stuttgart - www.region-stuttgart.de
Neu: emobil-in-bw.de
Neukunde: Statistisches Landesamt BaWü
--------------------------------
d-mind bei Facebook: http://www.facebook.com/werbeagentur.internetagentur.stuttgart
--------------------------------
d-mind
Fuchs/Weiß/Strobel GbR
Mörikestraße 69
70199 Stuttgart
Tel.: +49 711 280481-1 (Durchwahl: -18)
Fax: +49 711 2804813
Inhaber: Jens Fuchs, Michael Weiß, Jens Strobel
www.d-mind.de



More information about the TYPO3-project-typo3v4mvc mailing list