@see http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/ProductService/help/operations/FindProductNumbersByKeyword

@param string $keyword
@param int $siteId
@return array
972735
public function findProductNumbersByKeyword(string $keyword, int $siteId) : array
    {
        Assert::that($keyword)->minLength(1, 'The length of $keyword has to be > 0');
        Assert::that($siteId)->greaterThan(0, 'The $siteId has to be positive');

        return (array)$this->master->doRequest(
            'GET',
            sprintf(
                '/admin/WEBAPI/Endpoints/v1_0/ProductService/{KEY}/FindProductNumbersByKeyword/%s/%d',
                rawurlencode($keyword),
                $siteId
            )
        );
    }
288463
protected function getSite($siteId)
    {
        try {
            /** @var Site $site */
            $site = $this->getSiteRepo()->findOneBy(['siteId' => $siteId]);
        } catch (\Exception $e) {
            $site = null;
        }

        return $site;
    }
600398
public function getUrlTrackSiteSearch($keyword, $category, $countResults)
    {
        $url = $this->getRequest($this->idSite);
        $url .= '&search=' . urlencode($keyword);
        if (strlen($category) > 0) {
            $url .= '&search_cat=' . urlencode($category);
        }
        if (!empty($countResults) || $countResults === 0) {
            $url .= '&search_count=' . (int)$countResults;
        }

        return $url;
    }
1191942
public function getProductRatingById($productId)
    {
        $this->validateProductId($productId);

        $queryBuilder = $this->queryBuilderFactory->create();
        $queryBuilder
            ->select([
                'OXID',
                'OXRATING',
                'OXRATINGCNT'
            ])
            ->from('oxarticles')
            ->where('oxid = :productId')
            ->setMaxResults(1)
            ->setParameter('productId', $productId);

        return $this->mapper->map(
            new ProductRating(),
            $queryBuilder->execute()->fetch()
        );
    }
1348981
public function countWithFilterAndSiteIds(PaginateFinderConfiguration $configuration, $language, array $siteIds)
    {
        $qa = $this->createAggregationQuery();
        $this->filterSearchAndSiteIds($configuration, $language, $siteIds, $qa);

        return $this->countDocumentAggregateQuery($qa);
    }
1161681
public function getPerimeterConfiguration($siteId)
    {
        $treeFolders = $this->folderRepository->findFolderTree($siteId);

        return $this->getTreePerimeterConfiguration($treeFolders);
    }
613895
protected function getProductIds( array $productItems )
	{
		$prodIds = [];

		foreach( $productItems as $product )
		{
			if( $product->getType() === 'select' ) {
				$prodIds = array_merge( $prodIds, array_keys( $product->getRefItems( 'product', 'default', 'default' ) ) );
			}
		}

		return $prodIds;
	}
1000534
public function getAllUrls(array $criteria = [], $siteId = null): array
    {
        return RouteMap::$plugin->routes->getAllUrls($criteria, $siteId);
    }
896656
public function getProductsByCategoryId($categoryId, $filterByNewProducts = false, $keyword = '', $productId = 0, $countMode = false)
    {
        $params = [
            'active' => APP_ON
        ];
        if (! $this->getLoggedUser()) {
            $params['isPrivate'] = APP_OFF;
        }

        $sql = 'SELECT ';
        $sql .= $this->getFieldsForProductListQuery();
        $sql .= "FROM ".$this->tablePrefix."product Products ";

        if (! $filterByNewProducts) {
            $sql .= "LEFT JOIN ".$this->tablePrefix."category_product CategoryProducts ON CategoryProducts.id_product = Products.id_product
                 LEFT JOIN ".$this->tablePrefix."category Categories ON CategoryProducts.id_category = Categories.id_category ";
        }

        $sql .= $this->getJoinsForProductListQuery();
        $sql .= $this->getConditionsForProductListQuery();

        if (! $filterByNewProducts) {
            $params['categoryId'] = $categoryId;
            $sql .= " AND CategoryProducts.id_category = :categoryId ";
            $sql .= " AND Categories.active = :active";
        }

        if ($filterByNewProducts) {
            $params['dateAdd'] = date('Y-m-d', strtotime('-' . Configure::read('appDb.FCS_DAYS_SHOW_PRODUCT_AS_NEW') . ' DAYS'));
            $sql .= " AND DATE_FORMAT(Products.created, '%Y-%m-%d') > :dateAdd";
        }

        if ($keyword != '') {
            $params['keyword'] = '%' . $keyword . '%';
            $sql .= " AND (Products.name LIKE :keyword OR Products.description_short LIKE :keyword) ";
        }

        if ($productId > 0) {
            $params['productId'] = $productId;
            $sql .= " AND Products.id_product = :productId ";
        }

        $sql .= $this->getOrdersForProductListQuery();
        $statement = $this->getConnection()->prepare($sql);
        $statement->execute($params);
        $products = $statement->fetchAll('assoc');
        $products = $this->hideProductsWithActivatedDeliveryRhythmOrDeliveryBreak($products);

        if (! $countMode) {
            return $products;
        } else {
            return count($products);
        }

        return $products;
    }
836331
public function getDataBySiteIdAndPageId($siteId, $pageId)
	{
	    $select = $this->tableGateway->getSql()->select();
	     
	    $select->columns(array('*'));
	     
	    $select->where(array("s404_site_id" => $siteId, 's404_page_id' => $pageId));
	    $resultSet = $this->tableGateway->selectWith($select);
	     
	    return $resultSet;
	}
1146023
protected function addTag($siteId, array $siteConfig)
	{
		$tag = new Tag([
			'attributes' => $this->getAttributesConfig($siteConfig),
			'rules'      => [
				'allowChild' => 'URL',
				'autoClose'  => true,
				'denyChild'  => [$siteId, $this->tagName]
			],
			'template'   => $this->templateBuilder->build($siteId, $siteConfig)
		]);

		$this->configurator->templateNormalizer->normalizeTag($tag);
		$this->configurator->templateChecker->checkTag($tag);
		$this->configurator->tags->add($siteId, $tag);

		return $tag;
	}
869367
public function getSiteUrlsFromId($siteId = null, $format = null)
    {
        $options = $this->getOptions($format)
            ->usePeriod(false);
        if (!is_null($siteId)) {
            $options->setSiteId($siteId);
        }

        return $this->request->send($options);
    }
433837
public function findOneByEmailAndWebsiteId($email, $websiteId)
    {

        // initialize the params
        $params = array(
            MemberNames::EMAIL      => $email,
            MemberNames::WEBSITE_ID => $websiteId
        );

        // if not, try to load the customer with the passed email and website ID
        $this->customerByEmailAndWebsiteIdStmt->execute($params);
        return $this->customerByEmailAndWebsiteIdStmt->fetch(\PDO::FETCH_ASSOC);
    }
237200
public function getNumberSubscribers($websiteId = 0)
    {
        return $this->addFieldToFilter(
            'subscriber_status',
            \Dotdigitalgroup\Email\Model\Newsletter\Subscriber::STATUS_SUBSCRIBED
        )
            ->addFieldToFilter('website_id', $websiteId)
            ->getSize();
    }
794829
protected function getIdProductListByKey(string $productListKey): int
    {
        if (!isset($this->idProductListCache[$productListKey])) {
            /** @var \Orm\Zed\ProductList\Persistence\SpyProductListQuery $productListQuery */
            $productListQuery = SpyProductListQuery::create()->select(SpyProductListTableMap::COL_ID_PRODUCT_LIST);

            /** @var int|null $idProductList */
            $idProductList = $productListQuery->findOneByKey($productListKey);

            if (!$idProductList) {
                throw new EntityNotFoundException(sprintf('Could not find Product List by key "%s"', $productListKey));
            }
            $this->idProductListCache[$productListKey] = $idProductList;
        }

        return $this->idProductListCache[$productListKey];
    }
368784
public function getCategoryUrls(string $category, array $criteria = [], $siteId = null): array
    {

        $criteria = array_merge([
            'group' => $category,
        ], $criteria);

        return $this->getElementUrls(Category::class, $criteria, $siteId);
    }
1368871
public function generatePerimeters($siteId)
    {
        $perimeters = array();
        foreach ($this->strategies as $strategy) {
            $perimeters = array_merge($perimeters, array($strategy->getType() => $strategy->generatePerimeter($siteId)));
        }

        return $perimeters;
    }