| Conditions | 2 | 
| Paths | 2 | 
| Total Lines | 13 | 
| Code Lines | 10 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 26 | public function deletePriceCategoriesAction() | ||
| 27 |     { | ||
| 28 |         $performanceEventId = $this->get('request')->query->get('performanceEvent_id'); | ||
| 29 | $em = $this->getDoctrine()->getManager(); | ||
| 30 |         $performanceEvent = $em->getRepository('AppBundle:PerformanceEvent')->find($performanceEventId); | ||
| 31 | $priceCategories = $performanceEvent->getPriceCategories(); | ||
| 32 |         foreach ($priceCategories as $priceCategory) { | ||
| 33 | $performanceEvent->removePriceCategories($priceCategory); | ||
| 34 | $em->persist($performanceEvent); | ||
| 35 | } | ||
| 36 | $em->flush(); | ||
| 37 | return new Response(); | ||
| 38 | } | ||
| 39 | } | ||
| 40 |