remove all callback in customer class before saving it
This commit is contained in:
@@ -147,6 +147,11 @@ class Customer extends BaseAction implements EventSubscriberInterface
|
|||||||
|
|
||||||
public function login(CustomerLoginEvent $event)
|
public function login(CustomerLoginEvent $event)
|
||||||
{
|
{
|
||||||
|
$customer = $event->getCustomer();
|
||||||
|
|
||||||
|
if (method_exists($customer, 'clearDispatcher')) {
|
||||||
|
$customer->clearDispatcher();
|
||||||
|
}
|
||||||
$this->securityContext->setCustomerUser($event->getCustomer());
|
$this->securityContext->setCustomerUser($event->getCustomer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,11 @@ trait ModelEventDispatcherTrait
|
|||||||
return $this->dispatcher;
|
return $this->dispatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function clearDispatcher()
|
||||||
|
{
|
||||||
|
$this->dispatcher = null;
|
||||||
|
}
|
||||||
|
|
||||||
protected function dispatchEvent($eventName, ActionEvent $event)
|
protected function dispatchEvent($eventName, ActionEvent $event)
|
||||||
{
|
{
|
||||||
if (!is_null($this->dispatcher)) {
|
if (!is_null($this->dispatcher)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user