@@ -8,7 +8,6 @@ |
||
8 | 8 | use FOS\RestBundle\Request\ParamFetcher; |
9 | 9 | use Maxpou\BeerBundle\Entity\Beer; |
10 | 10 | use Maxpou\BeerBundle\Form\Type\BeerApiType; |
11 | -use Maxpou\BeerBundle\Form\Type\BeerType; |
|
12 | 11 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; |
13 | 12 | use Symfony\Component\HttpFoundation\Request; |
14 | 13 | use Symfony\Component\HttpFoundation\Response; |
@@ -40,25 +40,25 @@ discard block |
||
40 | 40 | |
41 | 41 | $em = $this->getDoctrine()->getManager(); |
42 | 42 | $beers = $em ->getRepository('MaxpouBeerBundle:Beer') |
43 | - ->findBy( |
|
44 | - ['brewery' => $breweryId], |
|
45 | - ['name' => 'ASC'], $limit, $offset |
|
46 | - ); |
|
43 | + ->findBy( |
|
44 | + ['brewery' => $breweryId], |
|
45 | + ['name' => 'ASC'], $limit, $offset |
|
46 | + ); |
|
47 | 47 | |
48 | 48 | return $beers; |
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | - * Get a Beer entity |
|
53 | - * |
|
54 | - * @ApiDoc( |
|
55 | - * statusCodes={ |
|
56 | - * 200="Returned when successful", |
|
57 | - * 404="Returned when not found" |
|
58 | - * }) |
|
59 | - * @param UUID $breweryId Brewery Id |
|
60 | - * @param UUID $beerId Beer Id |
|
61 | - */ |
|
52 | + * Get a Beer entity |
|
53 | + * |
|
54 | + * @ApiDoc( |
|
55 | + * statusCodes={ |
|
56 | + * 200="Returned when successful", |
|
57 | + * 404="Returned when not found" |
|
58 | + * }) |
|
59 | + * @param UUID $breweryId Brewery Id |
|
60 | + * @param UUID $beerId Beer Id |
|
61 | + */ |
|
62 | 62 | public function getAction($breweryId, $beerId) |
63 | 63 | { |
64 | 64 | $brewery = $this->getDoctrine()->getManager() |
@@ -81,19 +81,19 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
84 | - * Add a Beer |
|
85 | - * |
|
86 | - * @ApiDoc( |
|
87 | - * statusCodes={ |
|
88 | - * 201="Returned when successful", |
|
89 | - * 400="Returned when parameter is wrong" |
|
90 | - * }, |
|
91 | - * input = { |
|
92 | - * "class" = "Maxpou\BeerBundle\Form\Type\BeerApiType", |
|
93 | - * "name" = "" |
|
94 | - * }) |
|
95 | - * @param UUID $breweryId Brewery Id |
|
96 | - */ |
|
84 | + * Add a Beer |
|
85 | + * |
|
86 | + * @ApiDoc( |
|
87 | + * statusCodes={ |
|
88 | + * 201="Returned when successful", |
|
89 | + * 400="Returned when parameter is wrong" |
|
90 | + * }, |
|
91 | + * input = { |
|
92 | + * "class" = "Maxpou\BeerBundle\Form\Type\BeerApiType", |
|
93 | + * "name" = "" |
|
94 | + * }) |
|
95 | + * @param UUID $breweryId Brewery Id |
|
96 | + */ |
|
97 | 97 | public function postAction($breweryId, Request $request) |
98 | 98 | { |
99 | 99 | $brewery = $this->getDoctrine()->getManager() |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | public function putAction($breweryId, Request $request, $beerId) |
143 | 143 | { |
144 | 144 | $beer = $this->getDoctrine()->getManager() |
145 | - ->getRepository('MaxpouBeerBundle:Beer') |
|
146 | - ->find($beerId); |
|
145 | + ->getRepository('MaxpouBeerBundle:Beer') |
|
146 | + ->find($beerId); |
|
147 | 147 | |
148 | 148 | if (!$beer) { |
149 | 149 | throw new HttpException(404, 'Unable to find this Beer entity'); |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | public function deleteAction($breweryId, $beerId) |
182 | 182 | { |
183 | 183 | $beer = $this->getDoctrine()->getManager() |
184 | - ->getRepository('MaxpouBeerBundle:Beer') |
|
185 | - ->find($beerId); |
|
184 | + ->getRepository('MaxpouBeerBundle:Beer') |
|
185 | + ->find($beerId); |
|
186 | 186 | |
187 | 187 | if ($beer) { |
188 | 188 | $em = $this->getDoctrine()->getManager(); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | { |
207 | 207 | $em = $this->getDoctrine()->getManager(); |
208 | 208 | $brewery = $em->getRepository('MaxpouBeerBundle:Brewery') |
209 | - ->find($breweryId); |
|
209 | + ->find($breweryId); |
|
210 | 210 | |
211 | 211 | if (!$brewery) { |
212 | 212 | throw new HttpException(404, 'Unable to find this Brewery entity'); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | $em = $this->getDoctrine()->getManager(); |
43 | 43 | $breweries = $em ->getRepository('MaxpouBeerBundle:Brewery') |
44 | - ->findBy([], ['name' => 'ASC'], $limit, $offset); |
|
44 | + ->findBy([], ['name' => 'ASC'], $limit, $offset); |
|
45 | 45 | |
46 | 46 | $context = SerializationContext::create()->setGroups(array('Default','list')); |
47 | 47 | $view = $this->view($breweries, 200); |
@@ -51,15 +51,15 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
54 | - * Get a Brewery entity |
|
55 | - * @ApiDoc( |
|
56 | - * statusCodes={ |
|
57 | - * 200="Returned when successful", |
|
58 | - * 400="Returned when parameter is wrong", |
|
59 | - * 404="Returned when not found" |
|
60 | - * }) |
|
61 | - * @param UUID $breweryId Brewery Id |
|
62 | - */ |
|
54 | + * Get a Brewery entity |
|
55 | + * @ApiDoc( |
|
56 | + * statusCodes={ |
|
57 | + * 200="Returned when successful", |
|
58 | + * 400="Returned when parameter is wrong", |
|
59 | + * 404="Returned when not found" |
|
60 | + * }) |
|
61 | + * @param UUID $breweryId Brewery Id |
|
62 | + */ |
|
63 | 63 | public function getAction($breweryId) |
64 | 64 | { |
65 | 65 | // * @Route(requirements={ |
@@ -82,20 +82,20 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
85 | - * Add a Brewery |
|
86 | - * |
|
87 | - * @ApiDoc( |
|
88 | - * statusCodes={ |
|
89 | - * 201="Returned when successful", |
|
90 | - * 400="Returned when parameter is wrong" |
|
91 | - * }, |
|
92 | - * input = { |
|
93 | - * "class" = "Maxpou\BeerBundle\Form\Type\BreweryType", |
|
94 | - * "groups"={"list"}, |
|
95 | - * "name" = "" |
|
96 | - * }, |
|
97 | - * ) |
|
98 | - */ |
|
85 | + * Add a Brewery |
|
86 | + * |
|
87 | + * @ApiDoc( |
|
88 | + * statusCodes={ |
|
89 | + * 201="Returned when successful", |
|
90 | + * 400="Returned when parameter is wrong" |
|
91 | + * }, |
|
92 | + * input = { |
|
93 | + * "class" = "Maxpou\BeerBundle\Form\Type\BreweryType", |
|
94 | + * "groups"={"list"}, |
|
95 | + * "name" = "" |
|
96 | + * }, |
|
97 | + * ) |
|
98 | + */ |
|
99 | 99 | public function postAction(Request $request) |
100 | 100 | { |
101 | 101 | $brewery = new Brewery(); |