45 $this->_customerSession = $customerSession;
48 parent::__construct($context);
63 $customer = $this->customerRepository->getById($this->_customerSession->getCustomerId());
69 $validationResult = $this->accountManagement->validate(
$customer);
70 if (!$validationResult->isValid()) {
72 foreach ($validationResult->getMessages() as $error) {
73 $this->messageManager->addErrorMessage($error);
77 $this->_actionFlag->set(
'', self::FLAG_NO_DISPATCH,
true);
78 return $this->resultRedirectFactory->create()->setPath(
'customer/account/edit');
__construct(\Magento\Framework\App\Action\Context $context, \Magento\Customer\Model\Session $customerSession, CustomerRepositoryInterface $customerRepository, AccountManagementInterface $accountManagement)
_preDispatchValidateCustomer($redirect=true, $addErrors=true)