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,34 @@
<?php
declare(strict_types=1);
/**
* @author Amasty Team
* @copyright Copyright (c) Amasty (https://www.amasty.com)
* @package Admin Actions Log for Magento 2
*/
namespace Amasty\AdminActionsLog\Restoring\RestoreValidator;
use Amasty\AdminActionsLog\Api\Data\LogEntryInterface;
use Amasty\AdminActionsLog\Model\OptionSource\LogEntryTypes;
class LogEntryTypeValidator implements RestoreValidatorInterface
{
/**
* @var array
*/
private $notRestorableCategories;
public function __construct(
array $notRestorableCategories
) {
$this->notRestorableCategories = $notRestorableCategories;
}
public function isValid(LogEntryInterface $logEntry): bool
{
return $logEntry->getType() == LogEntryTypes::TYPE_EDIT
&& !in_array($logEntry->getCategory(), $this->notRestorableCategories);
}
}
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
/**
* @author Amasty Team
* @copyright Copyright (c) Amasty (https://www.amasty.com)
* @package Admin Actions Log for Magento 2
*/
namespace Amasty\AdminActionsLog\Restoring\RestoreValidator;
use Amasty\AdminActionsLog\Api\Data\LogEntryInterface;
interface RestoreValidatorInterface
{
public function isValid(LogEntryInterface $logEntry): bool;
}
@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
/**
* @author Amasty Team
* @copyright Copyright (c) Amasty (https://www.amasty.com)
* @package Admin Actions Log for Magento 2
*/
namespace Amasty\AdminActionsLog\Restoring\RestoreValidator;
use Amasty\AdminActionsLog\Api\Data\LogEntryInterface;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Store\Model\StoreManagerInterface;
class ScopeValidator implements RestoreValidatorInterface
{
/**
* @var StoreManagerInterface
*/
private $storeManager;
public function __construct(
StoreManagerInterface $storeManager
) {
$this->storeManager = $storeManager;
}
public function isValid(LogEntryInterface $logEntry): bool
{
try {
$this->storeManager->getStore((int)$logEntry->getStoreId());
return true;
} catch (NoSuchEntityException $exception) {
return false;
}
}
}