[FLOW3-general] IdentityRoutePart does not match

Peter Rauber peter.rauber at werkraum.net
Tue Aug 28 20:44:20 CEST 2012


Hi Bastian,

ok, let's use your route-configuration: 

On Monday, August 27, 2012 9:50:23 AM UTC+2, Bastian Waidelich wrote:
>
> In your case, however, you won't need the object route part handler as 
> far as I can see as the technical identifier (usually the UUID) is used 
> by default anyways. So this should do the trick: 
>
>    name: 'Mypackage Article Item' 
>    uriPattern: 'article/{article}' 
>    defaults: 
>      '@package':    ' Mypackage' 
>      '@controller': 'Article' 
>
I dont configure the action in the route-configuration, as this is done by 
RestController::resolveActionMethodName by 
checking $this->request->getHttpRequest()->getMethod().
 
Now I want to update an Article and send a PUT-Request to the 
uri: Mypackage/article/71df811d-**8266-4742-b80f-2bc5eb628b12
The content of the request is 
JSON: {article:{name:'newName',otherProperty:'newValue'}

Is this correct?

My Article-Controller is a REST-Controller and when send a PUT-request this 
method is triggered:

/**
 * Updates the given article object
 *
 * @param \Dacapos\Domain\Model\Article\Article $article The article to 
update
 * @return void
 */
public function updateAction(Article $article) {
  $this->systemLogger->log($article->getName());
  $this->articleRepository->update($article);
}

This works so far (I get log entries), but the $article-argument of the 
updateAction contains not the sent PUT-data, but the current data of the 
persistent article. So no data is changed at all like this.
Do I have a mistake here in my code? I expeced the sent properties from the 
PUT-request to be mapped into the article-argument for the update-method.

Best regards,
Peter


More information about the FLOW3-general mailing list