[Flow] RestController - updated Objects are not persisted
Robert Berghegger
r_berghegger at web.de
Mon Oct 14 16:42:43 CEST 2013
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