[TYPO3-mvc] "Model->attach" does not change database
Yann PETIT
yannpetit at laposte.net
Wed Dec 2 20:49:49 CET 2009
Bonjour,
Sorry, it is surely a stupid problem, but i am stuck.
In a model, I have something like this :
---------------------------------------------------------------------------------
/**
* Foreign table objects list
*
* @var
Tx_Extbase_Persistence_ObjectStorage<Tx_MyExt_Domain_Model_Foreignclass>
* @lazy
*/
protected $foreignclass;
/**
* Add a foreign object in the list
*
* @param Tx_MyExt_Domain_Model_Foreignclass $foreignobject
* @return void
*/
public function addForeignclass(Tx_442_Domain_Model_Joueurl1
$foreignobject) {
var_dump($foreignobject); // Valid Object is returned
$this->foreignclass->attach($foreignobject); // No Error is
dsiplayed
}
-------------------------------------------------------------------------------------
In the controller, I have :
-------------------------------------------------------------------------------------
$model->addForeignclass($foreignobject);
return($model->getForeignclass()); //Gives me the good number of objects
(including the new one)
------------------------------------------------------------------------------------
But nothing appends in the database.
Tank you in advance for help
Yann PETIT
More information about the TYPO3-project-typo3v4mvc
mailing list