[TYPO3-mvc] "Model->attach" does not change database

Yann PETIT yannpetit at laposte.net
Fri Dec 4 16:26:28 CET 2009


Hello,

Resolved by using MM Table,

sorry pour le dérangement.

Yann


"Yann PETIT" <yannpetit at laposte.net> a écrit dans le message de news: 
mailman.1.1259828402.31384.typo3-project-typo3v4mvc at lists.typo3.org...
> Hello,
>
> I get the model in the controller from the feuser :
> -----------------------------------------------
> // Get feuser
> $this->feuserRepository = 
> t3lib_div::makeInstance('Tx_Extbase_Domain_Repository_FrontendUserRepository');
> $feUser = 
> $this->feuserRepository->findByUid((int)$GLOBALS['TSFE']->fe_user->user[$GLOBALS['TSFE']->fe_user->userid_column]);
>
> // Get Model
> $this->modelRepository = 
> t3lib_div::makeInstance('Tx_MyExt_Domain_Repository_ModelRepository');
> $model = $this->modelRepository->findOneByFeUser($feUser);  // 1:1 
> relation, Returns directly the first element
>
> The foreignclass is define in model like this :
> ---------------------------------------------
> 'foreignclass' => array (
>            'exclude' => 0,
>            'label' => 
> 'LLL:EXT:MyExt/Resources/Private/Language/locallang_db.xml:tx_MyExt_domain_model_model.foreignclass',
>            'config' => array (
>                'type' => 'select',
>                'foreign_table' => 'tx_MyExt_domain_model_foreignclass',
>                'foreign_table_where' => 'ORDER BY 
> tx_MyExt_domain_model_foreignclass.uid',
>                'size' => 20,
>                'minitems' => 0,
>                'maxitems' => 20,
>            )
>        ),
> --------------------------------------------
>
> Thank you for your help
>
> Yann
>
> "Joerg Schoppet" <joerg at schoppet.de> a écrit dans le message de news: 
> mailman.1.1259793767.9160.typo3-project-typo3v4mvc at lists.typo3.org...
>> Hi Yann,
>>
>> Yann PETIT wrote:
>>> $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
>>>
>> can you post your TCA-definitions for model and foreignclass?
>>
>> How do you get $model?
>>
>> Joerg
>
> 




More information about the TYPO3-project-typo3v4mvc mailing list