public function delete(Subscription $subscription) { $em = $this->getEntityManager(); foreach ($subscription->getSections() as $section) { $em->remove($section); } $em->remove($subscription); }