[FLOW3-general] Automatically add an object possible?

Mario Rimann typo3-coding at rimann.org
Tue Oct 26 21:42:09 CEST 2010


Hi

I'm working on adding a parent and a child object. Adding the parent
object works with the newAction() and createAction() as in the Blog
example. Adding the child object works fine, too (via the
childController's new/createActions).

But what I'd like to get, is that the parentController's createAction()
does not just add the new object to the repository, but also
automatically adds a corresponding childObject right away. I tried to
achieve this by the following createAction() in the parentController -
but it just throws me the following PHP error message (no Exception!):

Fatal error: Call to undefined method
F3\Cockpit\Domain\Model\Domain::FLOW3_AOP_Proxy_getProxyTargetClassName() in
/var/www/rimann.org/cockpit/Packages/Framework/FLOW3/Classes/Persistence/Backend/GenericPdo/Backend.php
on line 200


public function createAction(\F3\MyPackage\Domain\Model\Parent $newParent) {
	$this->parentRepository->add($newParent);
		
	$newChild = new \F3\MyPackage\Domain\Model\Child();
	$newChild->setParent($newParent);
	$newChild->setName($newParent->getName());
	$this->childRepository->add($newChild);
	$newParent->addChild($newChild);

	$this->flashMessageContainer->add('Your new parent was created.');

//	$this->redirect('index');
}

Anyone an idea what I'm doing wrong here?

Cheers,
Mario


More information about the FLOW3-general mailing list