9 class DeleteStore extends \Magento\Backend\Controller\Adminhtml\System\Store
16 $itemId = $this->
getRequest()->getParam(
'item_id',
null);
17 if (!(
$model = $this->_objectManager->create(\
Magento\
Store\Model\Store::class)->load($itemId))) {
18 $this->messageManager->addErrorMessage(
__(
'Something went wrong. Please try again.'));
20 $redirectResult = $this->resultRedirectFactory->create();
21 return $redirectResult->setPath(
'adminhtml/*/');
23 if (!
$model->isCanDelete()) {
24 $this->messageManager->addErrorMessage(
__(
'This store view cannot be deleted.'));
26 $redirectResult = $this->resultRedirectFactory->create();
27 return $redirectResult->setPath(
'adminhtml/*/editStore', [
'store_id' => $itemId]);
32 $resultPage = $this->createPage();
33 $resultPage->getConfig()->getTitle()->prepend(
__(
'Delete Store View'));
34 $resultPage->addBreadcrumb(
__(
'Delete Store View'),
__(
'Delete Store View'))
36 $resultPage->getLayout()->createBlock(\
Magento\Backend\Block\
System\
Store\Delete::class)
37 ->setFormActionUrl($this->
getUrl(
'adminhtml/*/deleteStorePost'))
38 ->setBackUrl($this->
getUrl(
'adminhtml/*/editStore', [
'store_id' => $itemId]))
39 ->setStoreTypeTitle(
__(
'Store View'))
getUrl($route='', $params=[])
_addDeletionNotice($typeTitle)