[FLOW3-general] Repository getting "Last Inserted Id" (Last inserted object with persistence ID)
Davide CD
dmichelangeli at hotmail.com
Wed Apr 18 21:32:16 CEST 2012
Hi there,
I'm a newbie and maybe my question could seem a bit obvious to all of you, but I was wondering how you could get the "last insert Id" of an object that has just been added to a repository. I mean:
//This is my controller (a REST Controller)class Hotel{
/* * @FLOW3\Inject * @var \MyPackage\Blog\Domain\Repository\HotelRepository */TYPO3\Blog\Domain\Repository\BlogRepository */$repository;
public function createAction(\MyPackage\Blog\Domain\Model\Hotel $hotel){
//at this point, $hotel has no persistence Id$this->repository->add($hotel);
//Now, here I would like to have back my "persisted" hotel object with his IDWhat should I do?? }
}
Thank you very much in advance,David
More information about the FLOW3-general
mailing list