Commit 5d82f628 authored by Vincent Horváth's avatar Vincent Horváth

fixed method type in rest backend

parent 91ffe3fa
......@@ -3,6 +3,7 @@
namespace App\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use FOS\RestBundle\Controller\Annotations as Rest;
use FOS\RestBundle\Controller\FOSRestController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
......
/**
* @Route("/#route#/{id}", name="remove_#modelName#")
* @Rest\Delete("/#route#/{id}", name="remove_#modelName#")
*/
public function remove#modelName#Action(int $id): ?#modelName#
{
......
/**
* @Route("/#route#/{id}", name="get_#modelName#")
* @Rest\Get("/#route#/{id}", name="get_#modelName#")
*/
public function get#modelName#Action(int $id): ?#modelName#
{
......
/**
* @Route("/#route#", name="get_list_#modelName#")
* @Rest\Get("/#route#", name="get_list_#modelName#")
*/
public function getList#modelName#Action(): array
{
......
/**
* @Route("/#route#", name="create_#modelName#")
* @Rest\Post("/#route#", name="create_#modelName#")
*/
public function create#modelName#Action(Request $request): ?#modelName#
{
......
/**
* @Route("/#route#/{id}", name="update_#modelName#")
* @Rest\Get("/#route#/{id}", name="update_#modelName#")
*/
public function update#modelName#Action(Request $request, int $id): ?#modelName#
{
return parent::update#modelName#Action($request);
return parent::update#modelName#Action($request, $id);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment