ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Plumrocket_CookieConsentPro
|
||||
* @copyright Copyright (c) 2025 Plumrocket Inc.
|
||||
* @license https://plumrocket.com/license End-user License Agreement
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Plumrocket\CookieConsentPro\Model\Consent;
|
||||
|
||||
use Magento\Customer\Helper\Session\CurrentCustomer;
|
||||
use Magento\Framework\App\Response\RedirectInterface;
|
||||
use Magento\Framework\HTTP\Header;
|
||||
use Magento\Framework\HTTP\PhpEnvironment\RemoteAddress;
|
||||
use Magento\Framework\Stdlib\DateTime\DateTime;
|
||||
use Magento\Store\Model\StoreManagerInterface;
|
||||
use Plumrocket\CookieConsent\Api\Data\ConsentLogInterface;
|
||||
use Plumrocket\CookieConsent\Api\Data\ConsentLogInterfaceFactory;
|
||||
use Plumrocket\CookieConsent\Model\ResourceModel\ConsentLog as ConsentLogResource;
|
||||
use Plumrocket\CookieConsentPro\Api\Data\ConsentLogInterface as ProConsentLogInterface;
|
||||
use Plumrocket\CookieConsentPro\Model\Config\Source\ConsentInitiator;
|
||||
use Plumrocket\GlobalPrivacyControl\Api\IsGpcSignalHandledInterface;
|
||||
|
||||
/**
|
||||
* @since 1.0.1
|
||||
*/
|
||||
class Logger extends \Plumrocket\CookieConsent\Model\Consent\Logger
|
||||
{
|
||||
/**
|
||||
* @var \Plumrocket\CookieConsent\Model\ResourceModel\ConsentLog
|
||||
*/
|
||||
private $consentLogResource;
|
||||
|
||||
/**
|
||||
* @var \Plumrocket\GlobalPrivacyControl\Api\IsGpcSignalHandledInterface
|
||||
*/
|
||||
private $isGpcSignalHandled;
|
||||
|
||||
/**
|
||||
* @param \Plumrocket\CookieConsent\Api\Data\ConsentLogInterfaceFactory $consentLogFactory
|
||||
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
|
||||
* @param \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress
|
||||
* @param \Magento\Framework\Stdlib\DateTime\DateTime $dateTime
|
||||
* @param \Magento\Customer\Helper\Session\CurrentCustomer $currentCustomer
|
||||
* @param \Plumrocket\CookieConsent\Model\ResourceModel\ConsentLog $consentLogResource
|
||||
* @param \Magento\Framework\HTTP\Header $httpHeader
|
||||
* @param \Magento\Framework\App\Response\RedirectInterface $redirect
|
||||
* @param \Plumrocket\GlobalPrivacyControl\Api\IsGpcSignalHandledInterface $isGpcSignalHandled
|
||||
*/
|
||||
public function __construct(
|
||||
ConsentLogInterfaceFactory $consentLogFactory,
|
||||
StoreManagerInterface $storeManager,
|
||||
RemoteAddress $remoteAddress,
|
||||
DateTime $dateTime,
|
||||
CurrentCustomer $currentCustomer,
|
||||
ConsentLogResource $consentLogResource,
|
||||
Header $httpHeader,
|
||||
RedirectInterface $redirect,
|
||||
IsGpcSignalHandledInterface $isGpcSignalHandled
|
||||
) {
|
||||
parent::__construct(
|
||||
$consentLogFactory,
|
||||
$storeManager,
|
||||
$remoteAddress,
|
||||
$dateTime,
|
||||
$currentCustomer,
|
||||
$consentLogResource,
|
||||
$httpHeader,
|
||||
$redirect
|
||||
);
|
||||
$this->consentLogResource = $consentLogResource;
|
||||
$this->isGpcSignalHandled = $isGpcSignalHandled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $settings
|
||||
* @return \Plumrocket\CookieConsent\Api\Data\ConsentLogInterface
|
||||
* @throws \Magento\Framework\Exception\AlreadyExistsException
|
||||
* @throws \Magento\Framework\Exception\NoSuchEntityException
|
||||
*/
|
||||
public function log(array $settings): ConsentLogInterface
|
||||
{
|
||||
$consentLog = parent::log($settings);
|
||||
|
||||
if ($this->isGpcSignalHandled->execute()) {
|
||||
$consentLog->setData(ProConsentLogInterface::INITIATED_BY, ConsentInitiator::INITIATOR_GPC);
|
||||
$this->consentLogResource->save($consentLog);
|
||||
}
|
||||
|
||||
return $consentLog;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user