[TYPO3-mvc] Getting uid of not persisted object

Michael Feinbier mf at hdnet.de
Tue Jun 29 10:17:16 CEST 2010


Hi Patrik,

Am 29.06.10 09:38, schrieb Lang, Patrik:

> But what if I need the uid while the script is running? Is there a mechanism to persist the data if I want to?
>
> In the Class Tx_Extbase_Persistence_Repository I haven't found something like that.

Yes of course there is. There a the methods ->add() and ->update() in 
Tx_Extbase_Persistence_Repository which do the trick.

$repository->add($model);

echo $model->getUid();

Hope that helps.

Micha




>
> I need this because I want to send an email containing the uid of the model which will be persisted.
>
> If you need more info, let me know
>
> Greets
> Patrik


More information about the TYPO3-project-typo3v4mvc mailing list