[FLOW3-general] Storing/Receiving Different Models with one Action
marc neuhaus
apocalip at googlemail.com
Wed Dec 23 14:29:36 CET 2009
Hello!
I'm currently diving into FLOW3 and love it!
I have a Controller with an action to create a New Model entity.
The Problem is, that the Class of this Model varies and is specified through
the request.
Here is a little code example of what i'm trying to accomplish:
/**
* Stores the Model
*
* @param object $object Should be able To Receive any Kind of Model Object
and initialize it
* @return void
*/
public function createAction(object $object) {
$modelClass = $this->request->getArgument("model");
$repository = getRepositoryForModel($modelClass);
$repository->add($object);
}
Could you give me a hint how i could accomplish something like this?
Greetings Marc Neuhaus
More information about the FLOW3-general
mailing list