valid customer removal

This commit is contained in:
Manuel Raynaud
2013-09-12 12:40:14 +02:00
parent 5d87e48ba0
commit 9856528a94
8 changed files with 115 additions and 16 deletions

View File

@@ -26,6 +26,7 @@ namespace Thelia\Action;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\ActionEvent;
use Thelia\Core\Event\CustomerCreateOrUpdateEvent;
use Thelia\Core\Event\CustomerEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\Customer as CustomerModel;
use Thelia\Core\Event\CustomerLoginEvent;
@@ -59,6 +60,13 @@ class Customer extends BaseAction implements EventSubscriberInterface
}
public function delete(CustomerEvent $event)
{
$customer = $event->getCustomer();
$customer->delete();
}
private function createOrUpdateCustomer(CustomerModel $customer, CustomerCreateOrUpdateEvent $event)
{
$customer->setDispatcher($this->getDispatcher());
@@ -144,6 +152,7 @@ class Customer extends BaseAction implements EventSubscriberInterface
TheliaEvents::CUSTOMER_UPDATEACCOUNT => array("modify", 128),
TheliaEvents::CUSTOMER_LOGOUT => array("logout", 128),
TheliaEvents::CUSTOMER_LOGIN => array("login" , 128),
TheliaEvents::CUSTOMER_DELETEACCOUNT => array("delete", 128),
);
}
}