update create customer form

This commit is contained in:
Manuel Raynaud
2013-07-01 15:39:58 +02:00
parent 762b5bc71c
commit 6e29294418
3 changed files with 52 additions and 12 deletions

View File

@@ -25,6 +25,7 @@ namespace Thelia\Action;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\ActionEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\BaseForm;
use Thelia\Form\CustomerCreation;
@@ -33,6 +34,9 @@ class Customer implements EventSubscriberInterface
public function create(ActionEvent $event)
{
$event->getDispatcher()->dispatch(TheliaEvents::BEFORE_CREATECUSTOMER, $event);
$request = $event->getRequest();
$customerForm = new CustomerCreation($request);
@@ -49,6 +53,8 @@ class Customer implements EventSubscriberInterface
$event->setFormError($form);
}
}
$event->getDispatcher()->dispatch(TheliaEvents::AFTER_CREATECUSTOMER, $event);
}
public function modify(ActionEvent $event)