|
|
@@ -227,14 +227,20 @@ class SubscriptionController extends ProducerBaseController |
|
|
|
} |
|
|
|
|
|
|
|
$subscriptionModule = $this->getSubscriptionModule(); |
|
|
|
$subscription = $subscriptionModule->findOneSubscriptionById($id); |
|
|
|
$subscriptionModule->deleteSubscription($subscription); |
|
|
|
$subscription = $subscriptionModule->getRepository()->findOneSubscriptionById($id); |
|
|
|
|
|
|
|
if($subscription) { |
|
|
|
$subscriptionModule->getBuilder()->deleteSubscription($subscription); |
|
|
|
// @TODO : gérer via événements |
|
|
|
$this->getSubscriptionModule()->getOrderManager() |
|
|
|
->deleteOrdersIncomingDistributionsFromSubscription($subscription); |
|
|
|
|
|
|
|
// @TODO : gérer via événements |
|
|
|
$this->getSubscriptionModule()->getOrderManager() |
|
|
|
->deleteOrdersIncomingDistributionsFromSubscription($subscription); |
|
|
|
$this->setFlash('success', 'Abonnement supprimé'); |
|
|
|
} |
|
|
|
else { |
|
|
|
$this->setFlash('error', 'Abonnement introuvable'); |
|
|
|
} |
|
|
|
|
|
|
|
$this->setFlash('success', 'Abonnement supprimé'); |
|
|
|
|
|
|
|
return $this->redirect(['subscription/index']); |
|
|
|
} |