[TYPO3-mvc] Getting object uid after "add"

Emmanuel Denoyelle denoyell at lippmann.lu
Mon Jan 16 17:20:37 CET 2012


It works.

Thanks you !


Emmanuel DENOYELLE

--------------------------------------------------------------------------------------------

Unité Systèmes d'Information & Organisation
Service Etudes et Développement

CRP-Gabriel Lippmann
41, rue du Brill
L-4422  BELVAUX

Tél. : +352 47 02 61 - 365
http://www.lippmann.lu
-------------------------------------------------------------------------------------------

typo3-project-typo3v4mvc-bounces at lists.typo3.org wrote on 16/01/2012
17:16:34:

> Hi Emmanuel,
>
> If you have an ObjectManager ready at hand:
>
> $this->objectManager->get('Tx_Extbase_Persistence_Manager')->persistAll
();
>
> ...which will persist all the domain objects which have been touched
> (and will add the UID you need)
>
> --
> Cheers,
> Claus
> http://fedext.net
>
> On Jan 16, 2012, at 5:14 PM, Emmanuel Denoyelle wrote:
>
> >
> > Hi everyone,
> >
> > I am wondering how to get an object uid just after adding it by the
> > repository.
> >
> > For example :
> >
> > $this->ficheRepository->add($newFiche);
> > $ficheId = $newFiche->getUid();
> >
> >
> > In this code, $ficheId stays uninitialize.
> >
> > How can I get the uid of an objects that just have been added en the
> > database ?
> >
> > Thanx
> >
> >
> > Emmanuel DENOYELLE
> > _______________________________________________
> > TYPO3-project-typo3v4mvc mailing list
> > TYPO3-project-typo3v4mvc at lists.typo3.org
> >
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list