Files

61 lines
1.5 KiB
PHP

<?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\ViewModel\Integration;
use Magento\Framework\Serialize\SerializerInterface;
use Magento\Framework\View\Element\Block\ArgumentInterface;
use Plumrocket\CookieConsentPro\Model\Integration\MicrosoftAds as MicrosoftAdsConfigModel;
/**
* @since 1.0.0
*/
class MicrosoftAds implements ArgumentInterface
{
/**
* @var \Plumrocket\CookieConsentPro\Model\Integration\MicrosoftAds
*/
private $microsoftAds;
/**
* @var \Magento\Framework\Serialize\SerializerInterface
*/
private $serializer;
/**
* @param \Plumrocket\CookieConsentPro\Model\Integration\MicrosoftAds $microsoftAds
* @param \Magento\Framework\Serialize\SerializerInterface $serializer
*/
public function __construct(
MicrosoftAdsConfigModel $microsoftAds,
SerializerInterface $serializer
) {
$this->microsoftAds = $microsoftAds;
$this->serializer = $serializer;
}
/**
* @return bool
*/
public function isEnabled(): bool
{
return $this->microsoftAds->isEnabled();
}
/**
* @return string
*/
public function getConsentTypesConfigJson(): string
{
return $this->serializer->serialize(
$this->microsoftAds->getConsentTypesConfig()
);
}
}