@param int $website

@return string|boolean
760860
public function getApiPassword($website = 0)
    {
        $value = $this->getWebsiteConfig(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_API_PASSWORD,
            $website
        );
        return $this->encryptor->decrypt($value);
    }
1032450
public function getModifiedWishlistToImport(\Magento\Store\Api\Data\WebsiteInterface $website, $limit = 100)
    {
        return $this->wishlistCollection->create()
                                        ->getModifiedWishlistToImportByWebsite($website, $limit);
    }
101573
public function getCanShowAdditionalSubscriptions($website)
    {
        return $this->getWebsiteConfig(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_ADDRESSBOOK_PREF_CAN_CHANGE_BOOKS,
            $website
        );
    }
876733
public function getPushIntegrationCode($websiteID)
    {
        if (empty($websiteID)) {
            return $this->handleError('Empty website id');
        }

        $requestResult = $this->sendRequest('/push/websites/' . $websiteID . '/code');

        return $this->handleResult($requestResult);
    }
296908
protected function getChoices($site)
    {
        $choices = array();
        $index = array();

        foreach ($site->getAliases() as $aliasId => $alias) {
            $choices[$aliasId] = $alias->getDomain() . '(' . $alias->getLanguage();
            if ($alias->getPrefix() != '') {
                $choices[$aliasId] .= ' - ' . $alias->getPrefix();
            }
            $choices[$aliasId] .= ')';
            if ($alias->isMain()) {
                array_unshift($index, $aliasId);
            } else {
                $index[] = $aliasId;
            }
        }

        return array_merge(array_flip($index), $choices);
    }
1173702
public function getDisplayType($website)
    {
        return $this->getReviewWebsiteSettings(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_REVIEW_DISPLAY_TYPE,
            $website
        );
    }
1224182
public static function getBySectionOfSite($page)
    {
        $identifier = sprintf('/multilingual/section/%s', $page->getCollectionID());
        $cache = \Core::make('cache/request');
        $item = $cache->getItem($identifier);
        if (!$item->isMiss()) {
            $returnID = $item->get();
        } else {

            $item->lock();

            $returnID = false;

            if ($page->isPageDraft()) {
                $tree = false;
                if ($page->getPageDraftTargetParentPageID()) {
                    $cParentID = $page->getPageDraftTargetParentPageID();
                    if ($cParentID) {
                        $parent = Page::getByID($cParentID);
                        $tree = $parent->getSiteTreeObject();
                    }
                }
            }

            if (!isset($tree)) {
                $tree = $page->getSiteTreeObject();
            }

            if ($tree instanceof SiteTree) {
                $returnID = $tree->getSiteHomePageID();
            }

            $cache->save($item->set($returnID));
        }

        if ($returnID) {
            return static::getByID($returnID);
        }
    }
1269784
public function getPageTree(Website $website, $isAdmin, $isMenu)
    {
        return $this->pageRepository->buildPageTree($website, $isAdmin, $isMenu);
    }
986929
public function extractCss($html)
    {
        $document = $this->createDomDocumentFromHtml($html);

        $xPath = new DOMXPath($document);

        $cssIdentifier = join('-', $this->loadedfiles);
        $htmlIdentifier = md5($html);

        $applicable_rules = array_filter(
            $this->rules,
            function (Rule $rule) use ($xPath, $cssIdentifier, $htmlIdentifier) {
                if (isset($this->cachedRules[$cssIdentifier][$htmlIdentifier][$rule->getSelector()])) {
                    return $this->cachedRules[$cssIdentifier][$htmlIdentifier][$rule->getSelector()];
                }

                $expression = $this->buildExpressionForSelector($rule->getSelector());

                if (!$expression) {
                    return false;
                }

                /** @var DOMNodeList $elements */
                $elements = $xPath->query($expression);

                if ($elements->length === 0) {
                    $this->cachedRules[$cssIdentifier][$htmlIdentifier][$rule->getSelector()] = false;
                    return false;
                }

                $this->cachedRules[$cssIdentifier][$htmlIdentifier][$rule->getSelector()] = true;

                return true;
            }
        );


        $this->resultCache->save('cachedRules', $this->cachedRules);

        return $applicable_rules;
    }
1047276
public function getPages(Website $website, $pageIds, $isAdmin, $isAPI)
    {
        if (!is_array($pageIds)) {
            $pageIds = [$pageIds];
        }
        $pages = $this->pageRepository->findPages($website, $pageIds, $isAdmin, $isAPI);

        return $pages;
    }
942178
private function isAuthorizeCustomDomain($website = 0)
    {
        $website = $this->storeManager->getWebsite($website);
        $customDomain = $website->getConfig(
            self::XML_PATH_CONNECTOR_CUSTOM_DOMAIN
        );

        return (bool)$customDomain;
    }
1308539
public function getGuestAddressBook($website)
    {
        $website = $this->storeManager->getWebsite($website);

        return $this->scopeConfig->getValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_GUEST_ADDRESS_BOOK_ID,
            \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE,
            $website->getid()
        );
    }
752264
public function setSite($site)
    {
        if (empty($site)) return $this;

        $this->checkSite($site);

        return $this->addMeta('site', $site);
    }
915711
public static function getHostname($url)
    {
        if (!isset(self::$cache[$url]['hostname'])) {
            self::$cache[$url]['hostname'] = self::parseUrl($url, PHP_URL_HOST);
        }

        return self::$cache[$url]['hostname'];
    }
886478
public function getSiteDomain(Site $site)
    {
        $domain = $site->getDomain();

        if (empty($domain)) {
            return $this->domainService->getDefaultDomainName();
        }

        $domainName = $domain->getDomainName();

        if (empty($domainName)) {
            return $this->domainService->getDefaultDomainName();
        }

        return $domainName;
    }
86543
public function isNewProductOnly($website)
    {
        return $this->getReviewWebsiteSettings(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_REVIEW_NEW_PRODUCT,
            $website
        );
    }
303512
public function getWebsiteApiClient($website = 0, $username = '', $password = '')
    {
        if ($username && $password) {
            $apiUsername = $username;
            $apiPassword = $password;
        } else {
            $apiUsername = $this->getApiUsername($website);
            $apiPassword = $this->getApiPassword($website);
        }

        $client = $this->clientFactory->create();
        $client->setApiUsername($apiUsername)
            ->setApiPassword($apiPassword);

        $websiteId = $this->storeManager->getWebsite($website)->getId();
        //Get api endpoint
        $apiEndpoint = $this->getApiEndpoint($websiteId, $client);

        //Set api endpoint on client
        if ($apiEndpoint) {
            $client->setApiEndpoint($apiEndpoint);
        }

        return $client;
    }