public function login(CustomerLoginEvent $event) { $customer = $event->getCustomer(); if (method_exists($customer, 'clearDispatcher')) { $customer->clearDispatcher(); } $this->securityContext->setCustomerUser($event->getCustomer()); }
public function loadCustomer() { $customer = CustomerQuery::create()->findOne(); if (null === $customer) { return null; } $this->securityContext->setCustomerUser($customer); return $customer; }