@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | /** |
79 | 79 | * Get id |
80 | 80 | * |
81 | - * @return UUID |
|
81 | + * @return integer |
|
82 | 82 | */ |
83 | 83 | public function getId() |
84 | 84 | { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | /** |
158 | 158 | * Get beers |
159 | 159 | * |
160 | - * @return \Doctrine\Common\Collections\Collection |
|
160 | + * @return Beer |
|
161 | 161 | */ |
162 | 162 | public function getBeers() |
163 | 163 | { |
@@ -14,8 +14,8 @@ |
||
14 | 14 | { |
15 | 15 | $client = static::createClient(); |
16 | 16 | $em = $client->getContainer() |
17 | - ->get('doctrine') |
|
18 | - ->getManager(); |
|
17 | + ->get('doctrine') |
|
18 | + ->getManager(); |
|
19 | 19 | |
20 | 20 | $loader = new Loader(); |
21 | 21 | $loader->addFixture(new LoadBeersData()); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $breweries = $em ->getRepository('MaxpouBeerBundle:Brewery') |
44 | 44 | ->findBy([], ['name' => 'ASC'], $limit, $offset); |
45 | 45 | |
46 | - $context = SerializationContext::create()->setGroups(array('Default','list')); |
|
46 | + $context = SerializationContext::create()->setGroups(array('Default', 'list')); |
|
47 | 47 | $view = $this->view($breweries, 200); |
48 | 48 | $view->setSerializationContext($context); |
49 | 49 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | throw new HttpException(404, 'Unable to find this Brewery entity'); |
74 | 74 | } |
75 | 75 | |
76 | - $context = SerializationContext::create()->setGroups(array('Default','details')); |
|
76 | + $context = SerializationContext::create()->setGroups(array('Default', 'details')); |
|
77 | 77 | $view = $this->view($brewery, 200); |
78 | 78 | $view->setSerializationContext($context); |
79 | 79 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $em->flush(); |
109 | 109 | |
110 | 110 | $view = $this->view($brewery, 201); |
111 | - $context = SerializationContext::create()->setGroups(array('Default','details')); |
|
111 | + $context = SerializationContext::create()->setGroups(array('Default', 'details')); |
|
112 | 112 | $view->setSerializationContext($context); |
113 | 113 | } else { |
114 | 114 | $view = $this->view($form, 400); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | $em = $this->getDoctrine()->getManager(); |
42 | 42 | $breweries = $em ->getRepository('MaxpouBeerBundle:Brewery') |
43 | - ->findBy([], ['name' => 'ASC'], $limit, $offset); |
|
43 | + ->findBy([], ['name' => 'ASC'], $limit, $offset); |
|
44 | 44 | |
45 | 45 | $context = SerializationContext::create()->setGroups(array('Default','list')); |
46 | 46 | $view = $this->view($breweries, 200); |
@@ -50,15 +50,15 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | - * Get a Brewery entity |
|
54 | - * @ApiDoc( |
|
55 | - * statusCodes={ |
|
56 | - * 200="Returned when successful", |
|
57 | - * 400="Returned when parameter is wrong", |
|
58 | - * 404="Returned when not found" |
|
59 | - * }) |
|
60 | - * @param UUID $breweryId Brewery Id |
|
61 | - */ |
|
53 | + * Get a Brewery entity |
|
54 | + * @ApiDoc( |
|
55 | + * statusCodes={ |
|
56 | + * 200="Returned when successful", |
|
57 | + * 400="Returned when parameter is wrong", |
|
58 | + * 404="Returned when not found" |
|
59 | + * }) |
|
60 | + * @param UUID $breweryId Brewery Id |
|
61 | + */ |
|
62 | 62 | public function getAction($breweryId) |
63 | 63 | { |
64 | 64 | $brewery = $this->getDoctrine()->getManager() |
@@ -77,20 +77,20 @@ discard block |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
80 | - * Add a Brewery |
|
81 | - * |
|
82 | - * @ApiDoc( |
|
83 | - * statusCodes={ |
|
84 | - * 201="Returned when successful", |
|
85 | - * 400="Returned when parameter is wrong" |
|
86 | - * }, |
|
87 | - * input = { |
|
88 | - * "class" = "Maxpou\BeerBundle\Form\Type\BreweryType", |
|
89 | - * "groups"={"list"}, |
|
90 | - * "name" = "" |
|
91 | - * } |
|
92 | - * ) |
|
93 | - */ |
|
80 | + * Add a Brewery |
|
81 | + * |
|
82 | + * @ApiDoc( |
|
83 | + * statusCodes={ |
|
84 | + * 201="Returned when successful", |
|
85 | + * 400="Returned when parameter is wrong" |
|
86 | + * }, |
|
87 | + * input = { |
|
88 | + * "class" = "Maxpou\BeerBundle\Form\Type\BreweryType", |
|
89 | + * "groups"={"list"}, |
|
90 | + * "name" = "" |
|
91 | + * } |
|
92 | + * ) |
|
93 | + */ |
|
94 | 94 | public function postAction(Request $request) |
95 | 95 | { |
96 | 96 | $brewery = new Brewery(); |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | public function cdeleteAction() |
196 | 196 | { |
197 | 197 | $this->getDoctrine()->getManager() |
198 | - ->getRepository('MaxpouBeerBundle:Brewery') |
|
199 | - ->deleteAll(); |
|
198 | + ->getRepository('MaxpouBeerBundle:Brewery') |
|
199 | + ->deleteAll(); |
|
200 | 200 | |
201 | 201 | return $this->view(null, 204); |
202 | 202 | } |
@@ -14,8 +14,8 @@ |
||
14 | 14 | { |
15 | 15 | $client = static::createClient(); |
16 | 16 | $em = $client->getContainer() |
17 | - ->get('doctrine') |
|
18 | - ->getManager(); |
|
17 | + ->get('doctrine') |
|
18 | + ->getManager(); |
|
19 | 19 | |
20 | 20 | $loader = new Loader(); |
21 | 21 | $loader->addFixture(new LoadBeersData()); |
@@ -14,8 +14,8 @@ |
||
14 | 14 | { |
15 | 15 | $client = static::createClient(); |
16 | 16 | $em = $client->getContainer() |
17 | - ->get('doctrine') |
|
18 | - ->getManager(); |
|
17 | + ->get('doctrine') |
|
18 | + ->getManager(); |
|
19 | 19 | |
20 | 20 | $loader = new Loader(); |
21 | 21 | $loader->addFixture(new LoadBeersData()); |
@@ -39,25 +39,25 @@ discard block |
||
39 | 39 | |
40 | 40 | $em = $this->getDoctrine()->getManager(); |
41 | 41 | $beers = $em ->getRepository('MaxpouBeerBundle:Beer') |
42 | - ->findBy( |
|
43 | - ['brewery' => $breweryId], |
|
44 | - ['name' => 'ASC'], $limit, $offset |
|
45 | - ); |
|
42 | + ->findBy( |
|
43 | + ['brewery' => $breweryId], |
|
44 | + ['name' => 'ASC'], $limit, $offset |
|
45 | + ); |
|
46 | 46 | |
47 | 47 | return $beers; |
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | - * Get a Beer entity |
|
52 | - * |
|
53 | - * @ApiDoc( |
|
54 | - * statusCodes={ |
|
55 | - * 200="Returned when successful", |
|
56 | - * 404="Returned when not found" |
|
57 | - * }) |
|
58 | - * @param UUID $breweryId Brewery Id |
|
59 | - * @param UUID $beerId Beer Id |
|
60 | - */ |
|
51 | + * Get a Beer entity |
|
52 | + * |
|
53 | + * @ApiDoc( |
|
54 | + * statusCodes={ |
|
55 | + * 200="Returned when successful", |
|
56 | + * 404="Returned when not found" |
|
57 | + * }) |
|
58 | + * @param UUID $breweryId Brewery Id |
|
59 | + * @param UUID $beerId Beer Id |
|
60 | + */ |
|
61 | 61 | public function getAction($breweryId, $beerId) |
62 | 62 | { |
63 | 63 | $brewery = $this->getDoctrine()->getManager() |
@@ -80,19 +80,19 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
83 | - * Add a Beer |
|
84 | - * |
|
85 | - * @ApiDoc( |
|
86 | - * statusCodes={ |
|
87 | - * 201="Returned when successful", |
|
88 | - * 400="Returned when parameter is wrong" |
|
89 | - * }, |
|
90 | - * input = { |
|
91 | - * "class" = "Maxpou\BeerBundle\Form\Type\BeerApiType", |
|
92 | - * "name" = "" |
|
93 | - * }) |
|
94 | - * @param UUID $breweryId Brewery Id |
|
95 | - */ |
|
83 | + * Add a Beer |
|
84 | + * |
|
85 | + * @ApiDoc( |
|
86 | + * statusCodes={ |
|
87 | + * 201="Returned when successful", |
|
88 | + * 400="Returned when parameter is wrong" |
|
89 | + * }, |
|
90 | + * input = { |
|
91 | + * "class" = "Maxpou\BeerBundle\Form\Type\BeerApiType", |
|
92 | + * "name" = "" |
|
93 | + * }) |
|
94 | + * @param UUID $breweryId Brewery Id |
|
95 | + */ |
|
96 | 96 | public function postAction($breweryId, Request $request) |
97 | 97 | { |
98 | 98 | $brewery = $this->getDoctrine()->getManager() |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | public function putAction($breweryId, Request $request, $beerId) |
142 | 142 | { |
143 | 143 | $beer = $this->getDoctrine()->getManager() |
144 | - ->getRepository('MaxpouBeerBundle:Beer') |
|
145 | - ->find($beerId); |
|
144 | + ->getRepository('MaxpouBeerBundle:Beer') |
|
145 | + ->find($beerId); |
|
146 | 146 | |
147 | 147 | if (!$beer) { |
148 | 148 | throw new HttpException(404, 'Unable to find this Beer entity'); |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | public function deleteAction($breweryId, $beerId) |
181 | 181 | { |
182 | 182 | $beer = $this->getDoctrine()->getManager() |
183 | - ->getRepository('MaxpouBeerBundle:Beer') |
|
184 | - ->find($beerId); |
|
183 | + ->getRepository('MaxpouBeerBundle:Beer') |
|
184 | + ->find($beerId); |
|
185 | 185 | |
186 | 186 | if ($beer) { |
187 | 187 | $em = $this->getDoctrine()->getManager(); |
@@ -205,14 +205,14 @@ discard block |
||
205 | 205 | { |
206 | 206 | $em = $this->getDoctrine()->getManager(); |
207 | 207 | $brewery = $em->getRepository('MaxpouBeerBundle:Brewery') |
208 | - ->find($breweryId); |
|
208 | + ->find($breweryId); |
|
209 | 209 | |
210 | 210 | if (!$brewery) { |
211 | 211 | throw new HttpException(404, 'Unable to find this Brewery entity'); |
212 | 212 | } |
213 | 213 | |
214 | 214 | $em->getRepository('MaxpouBeerBundle:Beer') |
215 | - ->deleteAll($brewery); |
|
215 | + ->deleteAll($brewery); |
|
216 | 216 | |
217 | 217 | return $this->view(null, 204); |
218 | 218 | } |
@@ -17,8 +17,8 @@ |
||
17 | 17 | public function deleteAll($brewery) |
18 | 18 | { |
19 | 19 | $query = $this->getEntityManager() |
20 | - ->createQuery('DELETE FROM Maxpou\BeerBundle\Entity\Beer b WHERE b.brewery = :brewery') |
|
21 | - ->setParameter("brewery", $brewery); |
|
20 | + ->createQuery('DELETE FROM Maxpou\BeerBundle\Entity\Beer b WHERE b.brewery = :brewery') |
|
21 | + ->setParameter("brewery", $brewery); |
|
22 | 22 | |
23 | 23 | return $query->execute(); |
24 | 24 | } |