[TYPO3-english] showAction & uid for model object

Tomasz Krawczyk tomkrawc at gmail.com
Sat Nov 22 20:07:31 CET 2014


Hi list!

I'm writing an extension which extbase. My controller will have 
showAction without listAction. So, I will not pass ID for my model 
record. I'll get it from the database but I don't know How to send this 
ID to model class.

/**
  * action show
  *
  * @return void
  */
public function showAction() {
	
	$x = GeneralUtility::makeInstance('Vendor\\ExtName\\SomeClass');
	$myID = $x->getId()

	\Vendor\\ExtName\\Domain\Model\ModelClass $mc;

	???

	$this->view->assign('mc', $mc);
}

Let we say that SomeClass->getId() gets random record from the DB.

Do I have to execute all setters for my ModelClass ($mc object)?

cheers
Tomek


More information about the TYPO3-english mailing list