factory->create(); $this->resource->load($application, (int)$this->getRequest()->getParam('id')); if (!$application->getId()) { $this->messageManager->addErrorMessage(__('The VAT application no longer exists.')); return $this->resultRedirectFactory->create()->setPath('*/*/index'); } $this->registry->register('current_customer_vat_admin', $application); $page = $this->pageFactory->create(); $page->setActiveMenu('Esun_CustomerVat::applications'); $page->getConfig()->getTitle()->prepend(__('VAT Application #%1', $application->getId())); return $page; } }