Is subscriber sync enabled.

@param int $websiteId

@return bool
323137
public function isSubscriberSyncEnabled($websiteId = 0)
    {
        return $this->scopeConfig->getValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SYNC_SUBSCRIBER_ENABLED,
            \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE,
            $websiteId
        );
    }
298743
public function set($websiteId, ConfigInterface $config)
    {
        $foundDifference = false;

        foreach ($config->getData() as $key => $value) {
            if ($config->setConfigValue($key, $value, $websiteId)) {
                $foundDifference = true;
            }
        }

        if ($foundDifference) {
            $config->cleanScope();
        }

        return $this->statusResponseFactory->create()
            ->setStatus('ok');
    }
780883
public function isSatisfiedBy($userId): bool
    {
        try {
            $this->userService->loadUser($userId);

            return true;
        } catch (NotFoundException $e) {
            return false;
        }
    }
537233
public function sync()
    {
        $enabled = $this->helper->isEnabled();
        $catalogSyncEnabled = $this->helper->isCatalogSyncEnabled();

        if (!$enabled || !$catalogSyncEnabled) {
            return 0;
        }

        $limit = $this->scopeConfig->getValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_TRANSACTIONAL_DATA_SYNC_LIMIT
        );

        $products = $this->storeCatalogSyncer->syncByStore(
            null,
            0,
            $limit,
            'Catalog_Default'
        );

        /*
         * Sits outside of syncByStore - behaviour differs at store level.
         * At store level, we gather products from all stores first, then mark them as imported,
         * to allow for products being synced with multiple stores.
         */
        $this->catalogResource->setImportedByIds(array_keys($products));

        return count($products);
    }
471423
public function syncItem($item, $importData, $websiteId)
    {
        if ($this->client) {
            if ($item->getImportMode() == Importer::MODE_CONTACT_EMAIL_UPDATE) {
                $result = $this->syncItemContactEmailUpdateMode($importData, $websiteId);
            } elseif ($item->getImportMode() == Importer::MODE_SUBSCRIBER_RESUBSCRIBED) {
                $result = $this->syncItemSubscriberResubscribedMode($importData, $websiteId);
            } elseif ($item->getImportMode() == Importer::MODE_SUBSCRIBER_UPDATE) {
                $result = $this->syncItemSubscriberUpdateMode($importData, $websiteId);
            }

            if (isset($result)) {
                $this->_handleSingleItemAfterSync($item, $result);
            }
        }
    }
345880
public function sync()
    {
        $limit = $this->scopeConfig->getValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_TRANSACTIONAL_DATA_SYNC_LIMIT
        );
        $stores = $this->helper->getStores();
        $products = [];

        foreach ($stores as $store) {
            $enabled = $this->helper->isEnabled($store->getWebsiteId());
            $catalogSyncEnabled = $this->helper->isCatalogSyncEnabled($store->getWebsiteId());

            if (!$enabled || !$catalogSyncEnabled) {
                continue;
            }

            $storeId = $store->getId();
            $this->appEmulation->startEnvironmentEmulation($storeId);

            $importType = 'Catalog_' . $store->getWebsite()->getCode() . '_' . $store->getCode();
            $products += $this->storeCatalogSyncer->syncByStore(
                $storeId,
                $store->getWebsiteId(),
                $limit,
                $importType
            );

            $this->appEmulation->stopEnvironmentEmulation();
        }

        /*
         * Sits outside of syncByStore by intention.
         * We grab products for sync from each store and put them all into an array, then we mark them all as imported.
         * This is to prevent products that need to be synced with multiple stores being marked as imported before they have been synced.
         */
        $this->catalogResource->setImportedByIds(array_keys($products));

        return count($products);
    }
111838
public function filterItemsForReview($items, $websiteId)
    {
        $order = $this->getOrder();

        if (empty($items) || ! $order) {
            return false;
        }

        //if customer is guest then no need to filter any items
        if ($order->getCustomerIsGuest()) {
            return $items;
        }

        if (!$this->helper->isNewProductOnly($websiteId)) {
            return $items;
        }

        $customerId = $order->getCustomerId();

        $items = $this->review->filterItemsForReview($items, $customerId, $order);

        return $items;
    }
421745
static public function is_async_enabled() {
        global $CFG;

        $async = false;
        if (!empty($CFG->enableasyncbackup)) {
            $async = true;
        }

        return $async;
    }
576057
static function isCacheEnabled()
    {
        if ( isset( $GLOBALS['eZSiteBasics'] ) )
        {
            $siteBasics = $GLOBALS['eZSiteBasics'];
            if ( isset( $siteBasics['no-cache-adviced'] ) and
                 $siteBasics['no-cache-adviced'] )
            {
                return false;
            }
        }

        $ini = eZINI::instance();
        $cacheEnabled = $ini->variable( 'TemplateSettings', 'NodeTreeCaching' ) == 'enabled';
        return $cacheEnabled;
    }
44777
private function syncItemSubscriberResubscribedMode($importData, $websiteId)
    {
        $email = $importData['email'];
        $apiContact = $this->client->postContacts($email);

        //resubscribe suppressed contacts
        if (isset($apiContact->message) &&
            $apiContact->message
            == \Dotdigitalgroup\Email\Model\Apiconnector\Client::API_ERROR_CONTACT_SUPPRESSED
        ) {
            $subscribersAddressBook = $this->helper->getWebsiteConfig(
                \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SUBSCRIBERS_ADDRESS_BOOK_ID,
                $websiteId
            );
            return ($subscribersAddressBook) ?
                $this->client->postAddressBookContactResubscribe($subscribersAddressBook, $email) :
                $this->client->postContactsResubscribe($this->client->getContactByEmail($email));
        }

        return false;
    }
41839
public function checkWebsiteBeforeSave($websiteId, $type, $ruleId = false)
    {
        return $this->getCollection()
            ->hasCollectionAnyItemsByWebsiteAndType($websiteId, $type, $ruleId);
    }
914419
public function sync()
    {
        $this->start = microtime(true);
        $websites    = $this->helper->getWebsites();

        foreach ($websites as $website) {
            //check if the guest is mapped and enabled
            $addresbook = $this->helper->getGuestAddressBook($website);
            $guestSyncEnabled = $this->helper->isGuestSyncEnabled($website);
            $apiEnabled = $this->helper->isEnabled($website);
            if ($addresbook && $guestSyncEnabled && $apiEnabled) {
                //sync guests for website
                $this->exportGuestPerWebsite($website);
            }
        }
        if ($this->countGuests) {
            $this->helper->log(
                '----------- Guest sync ----------- : ' .
                gmdate('H:i:s', microtime(true) - $this->start) .
                ', Total synced = ' . $this->countGuests
            );
        }
    }
120076
public function getSubscription($subscriptionId)
    {
        /** @var SubscriptionFbApi $response */
        $response = $this->call(new Request('subscription.get', array('subscription_id' => $subscriptionId)), 'DVelopment\FastBill\Model\SubscriptionFbApi');
        $subscriptions = $response->getResponse()->getSubscriptions();

        return reset($subscriptions);
    }
438851
private function checkCampignEnrolmentActive($programId, $websiteId)
    {
        //program is not set
        if (!$programId) {
            return false;
        }
        $client = $this->helper->getWebsiteApiClient($websiteId);
        $program = $client->getProgramById($programId);
        //program status
        if (isset($program->status)) {
            $this->programStatus = $program->status;
        }
        if (isset($program->status) && $program->status == 'Active') {
            return true;
        }

        return false;
    }
243242
public function isUserActivated($userId): bool
    {
        $ngUserSetting = $this->findOneBy(['userId' => $userId]);

        if ($ngUserSetting instanceof NgUserSetting) {
            return $ngUserSetting->getIsActivated();
        }

        return false;
    }
183427
public static function connectSubscriptions($customerUUID, array $data = [], ClientInterface $client = null)
    {
        (new static([], $client))
            ->getClient()
            ->setResourcekey(static::class)
            ->send('/v1/customers/'.$customerUUID.'/connect_subscriptions', 'POST', $data);
        return true;
    }
18757
public function getSettingBySiteId($siteId)
    {
        /** @var $query QueryBuilder */
        $params = ['dataSource' => $siteId];
        $qb     = $this->getFindByQueryBuilder($params, null, 'e', ['id','settingValue']);
        $qb->addSelect('partial k.{id,code,defaultValue}')
            ->innerJoin('e.settingKey', 'k');

        return $qb->getQuery()->getResult();
    }