src/Sulu/Bundle/AudienceTargetingBundle/Controller/TargetGroupController.php
public function putAction(Request $request, $id)
    {
        $jsonData = $request->getContent();
        $data = json_decode($jsonData, true);

        // Id should be taken of request uri.
        $data['id'] = $id;

        $targetGroup = $this->deserializeData(json_encode($data));
        $targetGroup = $this->getTargetGroupRepository()->save($targetGroup);
        $this->getEntityManager()->flush();

        return $this->handleView($this->view($targetGroup));
    }
public function putAction(Request $request, $id)
    {
        $jsonData = $request->getContent();
        $data = json_decode($jsonData, true);

        // Id should be taken of request uri.
        $data['id'] = $id;

        $targetGroup = $this->deserializeData(json_encode($data));
        $targetGroup = $this->getTargetGroupRepository()->save($targetGroup);
        $this->getEntityManager()->flush();

        return $this->handleView($this->view($targetGroup));
    }
public function putAction ( Request $ request , $ id ) { $ jsonData = $ request -> getContent ( ) ; $ data = json_decode ( $ jsonData , true ) ; // Id should be taken of request uri. $ data [ 'id' ] = $ id ; $ targetGroup = $ this -> deserializeData ( json_encode ( $ data ) ) ; $ targetGroup = $ this -> getTargetGroupRepository ( ) -> save ( $ targetGroup ) ; $ this -> getEntityManager ( ) -> flush ( ) ; return $ this -> handleView ( $ this -> view ( $ targetGroup ) ) ; }
Handle put request for target group.

@param Request $request
@param int $id

@return Response
Handle put request for target group .