<?php

namespace Benhauer\Salesmanago\Helper;

use \Magento\Directory\Api\CountryInformationAcquirerInterface;
use \Magento\Framework\App\ProductMetadata;
use \Magento\Newsletter\Model\Subscriber;
use \Magento\Framework\App\Helper\Context;

class Tools
{
    public $metaData;
    public $subscriber;
    public $countryInformation;
    public $logger;
    public $scopeConfig;
    public $assetRepository;
    public $storeManager;

    public function __construct(
        ProductMetadata $metaData,
        Subscriber $subscriber,
        CountryInformationAcquirerInterface $countryInformation,
        Context $context
    ) {
        $this->metaData           = $metaData;
        $this->subscriber         = $subscriber;
        $this->countryInformation = $countryInformation;
        $this->logger             = $context->getLogger();
        $this->scopeConfig        = $context->getScopeConfig();
    }

    public function getScopeConfig()
    {
        return $this->scopeConfig;
    }

    public function checkSubscription($customerId)
    {
        $subscriber = $this->subscriber->loadByCustomerId($customerId);
        return $subscriber->isSubscribed();
    }
}
