ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
@@ -0,0 +1,41 @@
<?php
/**
* @author Amasty Team
* @copyright Copyright (c) Amasty (https://www.amasty.com)
* @package Elastic Search Base for Magento 2
*/
namespace Amasty\ElasticSearch\Controller\Adminhtml\RelevanceRule;
use Amasty\ElasticSearch\Api\Data\RelevanceRuleInterface;
use Magento\Framework\Controller\ResultFactory;
class Edit extends AbstractRelevance
{
/**
* @inheritdoc
*/
public function execute()
{
$ruleId = (int)$this->getRequest()->getParam(RelevanceRuleInterface::RULE_ID);
try {
if ($ruleId) {
/** @var \Amasty\ElasticSearch\Model\RelevanceRule $model */
$model = $this->ruleRepository->get($ruleId);
} else {
$model = $this->ruleFactory->create();
}
$this->registry->register(self::CURRENT_RULE, $model);
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
$this->messageManager->addErrorMessage(__('This Relevance Rule is no longer exists.'));
$resultRedirect = $this->resultRedirectFactory->create();
return $resultRedirect->setPath('*/*/');
}
$resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
$text = $model->getId() ? $model->getTitle() : __('New Relevance Rule');
$this->initPage($resultPage)->getConfig()->getTitle()->prepend($text);
return $resultPage;
}
}