$subscriptionModule = $this->getSubscriptionModule(); | $subscriptionModule = $this->getSubscriptionModule(); | ||||
$orderModule = $this->getOrderModule(); | $orderModule = $this->getOrderModule(); | ||||
$subscription = $subscriptionModule->findOneSubscriptionById($id); | |||||
$subscriptionModule->getOrderManager()->deleteOrdersIncomingDistributionsFromSubscription($subscription); | |||||
$subscriptionModule->deleteSubscription($subscription); | |||||
$subscription = $subscriptionModule->getRepository()->findOneSubscriptionById($id); | |||||
$this->setFlash('success', 'Abonnement supprimé'); | |||||
if($subscription) { | |||||
$subscriptionModule->getOrderManager()->deleteOrdersIncomingDistributionsFromSubscription($subscription); | |||||
$subscriptionModule->deleteSubscription($subscription); | |||||
$this->setFlash('success', 'Abonnement supprimé'); | |||||
} | |||||
else { | |||||
$this->setFlash('danger', 'Abonnement introuvable'); | |||||
} | |||||
return $this->redirect(['subscription/index']); | return $this->redirect(['subscription/index']); | ||||
} | } |
} | } | ||||
$subscriptionModule = $this->getSubscriptionModule(); | $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']); | return $this->redirect(['subscription/index']); | ||||
} | } |