[FLOW3-general] Repository getting "Last Inserted Id" (Last inserted object with persistence ID)
Davide CD
dmichelangeli at hotmail.com
Thu Apr 19 12:46:00 CEST 2012
Hi Karsten
thank you very much for the reply.Yes, I use the JsonView class (actually, a derived class). All the JSON requests and responses are managed by this class. I'm also planning to implement (in my JsonView-derived class) a method that formats a JSON string with all the FLOW3 Validation Errors and to send it back to my ExtJS Forms. The goal is to have a double validation: client and server side.At this moment, I'm just thinking about it, but I would like to implement a sort of "framework" and use it in all my future projects.
Thanks for your work!Davide (from Switzerland)
> From: karsten at typo3.org
> Date: Thu, 19 Apr 2012 11:06:07 +0200
> To: flow3-general at lists.typo3.org
> Subject: Re: [FLOW3-general] Repository getting "Last Inserted Id" (Last inserted object with persistence ID)
>
> Hi.
>
> On 18.04.12 21:32, Davide CD wrote:
> > public function createAction(\MyPackage\Blog\Domain\Model\Hotel $hotel){
> > //at this point, $hotel has no persistence Id$this->repository->add($hotel);
>
> It has. Unless you explicitly assign an Id annotation to your model,
> FLOW3 will make sure a UUID is generated when instantiating an entity.
> Thus, the UUID exists even if an entity is never persisted.
>
> You can, consequently, always use getIdentifierByObject() on the
> PersistenceManager. But, as Sebastian pointed out already, you should
> not need this in most cases. Did you look at the JSON view already?
>
> Regards,
> Karsten
> --
> Karsten Dambekalns
> TYPO3 Core Developer, FLOW3 / Phoenix Team
>
> TYPO3 .... inspiring people to share!
> Get involved: typo3.org
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
More information about the FLOW3-general
mailing list