ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Plumrocket_GlobalPrivacyControl
|
||||
* @copyright Copyright (c) 2025 Plumrocket Inc.
|
||||
* @license https://plumrocket.com/license End-user License Agreement
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Plumrocket\GlobalPrivacyControl\Model;
|
||||
|
||||
use Magento\Framework\Stdlib\BooleanUtils;
|
||||
use Magento\Framework\Stdlib\Cookie\CookieReaderInterface;
|
||||
use Plumrocket\GlobalPrivacyControl\Api\IsGpcSignalHandledInterface;
|
||||
|
||||
class IsGpcSignalHandled implements IsGpcSignalHandledInterface
|
||||
{
|
||||
/**
|
||||
* @var \Magento\Framework\Stdlib\BooleanUtils
|
||||
*/
|
||||
private $booleanUtils;
|
||||
|
||||
/**
|
||||
* @var \Magento\Framework\Stdlib\Cookie\CookieReaderInterface
|
||||
*/
|
||||
private $cookieReader;
|
||||
|
||||
/**
|
||||
* @param \Magento\Framework\Stdlib\BooleanUtils $booleanUtils
|
||||
* @param \Magento\Framework\Stdlib\Cookie\CookieReaderInterface $cookieReader
|
||||
*/
|
||||
public function __construct(
|
||||
BooleanUtils $booleanUtils,
|
||||
CookieReaderInterface $cookieReader
|
||||
) {
|
||||
$this->booleanUtils = $booleanUtils;
|
||||
$this->cookieReader = $cookieReader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function execute(): bool
|
||||
{
|
||||
$status = $this->cookieReader->getCookie(self::COOKIE_NAME);
|
||||
return $status && $this->booleanUtils->toBoolean($status);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user