[Flow] RestController - updated Objects are not persisted
Stephen Bungert
stephenbungert at yahoo.de
Mon Oct 14 16:54:53 CEST 2013
I believe persistAll is only called for POST,
you could manually call it in your action.
Stephen,
"Robert Berghegger" <r_berghegger at web.de> schrieb im Newsbeitrag
news:mailman.2018.1381761776.588.flow at lists.typo3.org...
> Hello everyone,
>
> I have a question belonging to the RestController.
>
> My routing-setup:
>
> -
> name: 'Single CD URI'
> uriPattern: 'cd/{cd}'
> defaults:
> '@package': 'Berghegger.CD'
> '@controller': 'CD'
>
> -
> name: 'CD List URI'
> uriPattern: 'cd'
> defaults:
> '@package': 'Berghegger.CD'
> '@controller': 'CD'
>
> Everytime I create an CD-Object with a HTTP-POST to:
>
> http://flow.robert-pc/index.php/cd
>
> with a Body like this:
>
> cd[title]=Eternal Movement&cd[artist]=Tides from nebula
>
> It is successfull persited and I can retreive the Object with a HTTP-GET
> to:
>
> http://flow.robert-pc/index.php/cd/b068de1b-e53e-706f-a17e-a7b08176ca92
>
> the result looks like this:
>
> 1. {
> 2. "artist": "Tides from nebula",
> 3. "title": "Eternal Movement",
> 4. "__identity": "b068de1b-e53e-706f-a17e-a7b08176ca92"
> 5. }
> I can also delete this object. So far, so good.
>
> But when I try to update this Object with a HTTP-PUT the changes are not
> persisted, though the updateAction is triggered.
>
> /**
> *
> * @param \Berghegger\CD\Domain\Model\CD $cd The updated CD-Object
> * @return void
> */
> public function updateAction(CD $cd) {
> $this->cdRepository->update($cd);
> $this->response->setStatus(201);
>
> }
>
> What am i doing wrong?
>
> Kind regards,
>
> Robert
>
More information about the Flow
mailing list