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

Claus Due claus at wildside.dk
Mon Jan 16 17:16:34 CET 2012


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



More information about the TYPO3-project-typo3v4mvc mailing list