validate create and update address in front context
This commit is contained in:
@@ -109,7 +109,7 @@ class Category extends BaseAction implements EventSubscriberInterface
|
||||
$customer = CustomerQuery::create()->findPk(1);
|
||||
try {
|
||||
$customerEvent = new CustomerEvent($customer);
|
||||
$event->getDispatcher()->dispatch(TheliaEvents::BEFORE_CHANGECUSTOMER, $customerEvent);
|
||||
$event->getDispatcher()->dispatch(TheliaEvents::BEFORE_UPDATECUSTOMER, $customerEvent);
|
||||
|
||||
$data = $form->getData();
|
||||
|
||||
@@ -127,7 +127,7 @@ class Category extends BaseAction implements EventSubscriberInterface
|
||||
);
|
||||
|
||||
$customerEvent->customer = $customer;
|
||||
$event->getDispatcher()->dispatch(TheliaEvents::AFTER_CHANGECUSTOMER, $customerEvent);
|
||||
$event->getDispatcher()->dispatch(TheliaEvents::AFTER_UPDATECUSTOMER, $customerEvent);
|
||||
|
||||
// Update the logged-in user, and redirect to the success URL (exits)
|
||||
// We don-t send the login event, as the customer si already logged.
|
||||
|
||||
@@ -78,11 +78,11 @@ final class TheliaEvents
|
||||
/**
|
||||
* Sent once the customer change form has been successfully validated, and before customer update in the database.
|
||||
*/
|
||||
const BEFORE_CHANGECUSTOMER = "action.before_changecustomer";
|
||||
const BEFORE_UPDATECUSTOMER = "action.before_changecustomer";
|
||||
/**
|
||||
* Sent just after a successful update of a customer in the database.
|
||||
*/
|
||||
const AFTER_CHANGECUSTOMER = "action.after_changecustomer";
|
||||
const AFTER_UPDATECUSTOMER = "action.after_changecustomer";
|
||||
|
||||
/**
|
||||
* Sent once the category creation form has been successfully validated, and before category insertion in the database.
|
||||
|
||||
@@ -125,7 +125,7 @@ class Customer extends BaseCustomer implements UserInterface
|
||||
public function preUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
$customerEvent = new CustomerEvent($this);
|
||||
$this->dispatchEvent(TheliaEvents::BEFORE_CHANGECUSTOMER, $customerEvent);
|
||||
$this->dispatchEvent(TheliaEvents::BEFORE_UPDATECUSTOMER, $customerEvent);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ class Customer extends BaseCustomer implements UserInterface
|
||||
public function postUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
$customerEvent = new CustomerEvent($this);
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_CHANGECUSTOMER, $customerEvent);
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_UPDATECUSTOMER, $customerEvent);
|
||||
}
|
||||
|
||||
protected function dispatchEvent($eventName, CustomerEvent $customerEvent)
|
||||
|
||||
Reference in New Issue
Block a user