public function createAction(AnnouncementAggregate $aggregate, Request $request)
    {
        $this->checkPermission('EDIT', $aggregate->getResourceNode(), [], true);
        $data = $this->decodeRequest($request);
        $data['aggregate'] = ['id' => $aggregate->getUuid()];

        /** @var Announcement $announcement */
        $announcement = $this->crud->create($this->getClass(), $data, [
          'announcement_aggregate' => $aggregate,
        ]);

        return new JsonResponse(
            $this->serializer->serialize($announcement),
            201
        );
    }
public function createAction(AnnouncementAggregate $aggregate, Request $request)
    {
        $this->checkPermission('EDIT', $aggregate->getResourceNode(), [], true);
        $data = $this->decodeRequest($request);
        $data['aggregate'] = ['id' => $aggregate->getUuid()];

        /** @var Announcement $announcement */
        $announcement = $this->crud->create($this->getClass(), $data, [
          'announcement_aggregate' => $aggregate,
        ]);

        return new JsonResponse(
            $this->serializer->serialize($announcement),
            201
        );
    }
public function createAction ( AnnouncementAggregate $ aggregate , Request $ request ) { $ this -> checkPermission ( 'EDIT' , $ aggregate -> getResourceNode ( ) , [ ] , true ) ; $ data = $ this -> decodeRequest ( $ request ) ; $ data [ 'aggregate' ] = [ 'id' => $ aggregate -> getUuid ( ) ] ; /** @var Announcement $announcement */ $ announcement = $ this -> crud -> create ( $ this -> getClass ( ) , $ data , [ 'announcement_aggregate' => $ aggregate , ] ) ; return new JsonResponse ( $ this -> serializer -> serialize ( $ announcement ) , 201 ) ; }
Creates a new announce.

@EXT\Route("/", name="claro_announcement_create")
@EXT\Method("POST")

@param AnnouncementAggregate $aggregate
@param Request               $request

@return JsonResponse
Creates a new announce .