Return the price index tables according to the price index dimensions for the given website.

@param integer $websiteId Website id.

@return array
197829
private function getPriceIndexDimensionsTables($websiteId)
    {
        $tables = [];

        $indexDimensions = $this->getPriceIndexDimensions($websiteId);
        foreach ($indexDimensions as $dimensions) {
            $tables[] = $this->priceTableResolver->resolve('catalog_product_index_price', $dimensions);
        }

        return $tables;
    }
684172
protected function getTableIndexes(): array
    {
        $data = [];

        $idxs = $this->db->schema->getTableIndexes($this->tableName, true);

        /* @var $idx IndexConstraint */
        foreach ($idxs as $idx) {
            if (!$idx->isPrimary) {
                $data[$idx->name] = new TableIndex([
                    'name' => $idx->name,
                    'unique' => $idx->isUnique,
                    'columns' => $idx->columnNames
                ]);
            }
        }

        return $data;
    }
1050800
protected function getAcfFromPage(int $pageId): array
    {
        $data = [];
        try {
            $data = $this->wpProvider->getFields($pageId);
        } catch (\Throwable $e) {
            ;
        }

        if (!is_array($data) || empty($data)) return [];

        return $data;
    }
504663
public function getCategory(int $categoryId, int $siteId) : array
    {
        Assert::that($categoryId)->greaterThan(0, 'The $categoryId has to be positive');
        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}/Category/%d/%d', $categoryId, $siteId)
        );
    }
853246
public function certificates($serverId, $siteId)
    {
        return $this->transformCollection(
            $this->get("servers/$serverId/sites/$siteId/certificates")['certificates'],
            Certificate::class,
            ['server_id' => $serverId, 'site_id' => $siteId]
        );
    }
413286
public function similar($venueId)
    {

        $resource = '/venues/' . $venueId . '/similar';
        $response = $this->makeApiRequest($resource);

        if(property_exists($response, 'similarVenues')) {
            return $response->similarVenues->items;
        }

        return array();

    }
427123
public function getTableIndexes($tableName): array
    {
        $schema  = $this->getSchema();
        $indexes = $schema->listTableIndexes($tableName);

        return $indexes;
    }
1261217
protected function getIDListFromDB() : array
    {
        if ($this->sValue == ProductListStore::SORT_PRICE_ASC) {
            $arElementIDList = $this->getByPriceASC();
        } elseif ($this->sValue == ProductListStore::SORT_PRICE_DESC) {
            $arElementIDList = $this->getByPriceDESC();
        } elseif ($this->sValue == ProductListStore::SORT_NEW) {
            $arElementIDList = $this->getNewProductList();
        } elseif ($this->sValue == ProductListStore::SORT_NO) {
            $arElementIDList = $this->getProductList();
        } elseif (preg_match('%^'.ProductListStore::SORT_PRICE_ASC.'\|.+%', $this->sValue)) {
            $arElementIDList = $this->getByPriceTypeASC();
        } elseif (preg_match('%^'.ProductListStore::SORT_PRICE_DESC.'\|.+%', $this->sValue)) {
            $arElementIDList = $this->getByPriceTypeDESC();
        } else {
            $arElementIDList = $this->getCustomSortingList();
        }

        return $arElementIDList;
    }
4980
public function getProductsByBarcode(string $barCode, int $siteId) : array
    {
        Assert::that($barCode)->minLength(1, 'The length of $barCode 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}/ByBarcode/%s/%d', rawurlencode($barCode), $siteId)
        );
    }
961161
public function getItemsByOrderId($orderId)
    {
        $result = [];
        /* aliases and tables */
        $asOrder = 'sale';
        $asPvItem = 'pv';
        $tblOrder = [$asOrder => $this->resource->getTableName(Cfg::ENTITY_MAGE_SALES_ORDER_ITEM)];
        $tblPvItem = [$asPvItem => $this->resource->getTableName(Entity::ENTITY_NAME)];
        /* SELECT FROM sales_order_item */
        $query = $this->conn->select();
        $cols = [];
        $query->from($tblOrder, $cols);
        /* LEFT JOIN prxgt_pv_sale_item pwq */
        $on = $asPvItem . '.' . Entity::A_ITEM_REF . '=' . $asOrder . '.' . Cfg::E_SALE_ORDER_ITEM_A_ITEM_ID;
        $cols = '*'; // get all columns
        $query->joinLeft($tblPvItem, $on, $cols);
        /* WHERE */
        $where = $asOrder . '.' . Cfg::E_SALE_ORDER_ITEM_A_ORDER_ID . '=' . (int)$orderId;
        $query->where($where);
        /* fetch data */
        $rows = $this->conn->fetchAll($query);
        foreach ($rows as $row) {
            /** @var Entity $item */
            $item = new Entity($row);
            $result[$item->getItemRef()] = $item;
        }
        return $result;
    }
1326623
public function getTableRateCollection($storeId = null)
    {
        return $this->tableRateCollection->setWebsiteFilter($this->storeManager->getStore($storeId)->getWebsiteId());
    }
606982
public function findAllowedSites($siteId)
    {
        $qb = $this->createQueryBuilder();
        $qb->field('allowedSites')->in(array($siteId));

        return $qb->getQuery()->execute();
    }
912243
private function findWebsiteIdsInTimezoneWithNewDay($websiteIds)
    {
        $timezones = $this->getTimezonesHavingNewDaySinceLastRun();
        $websiteDayHasFinishedSinceLastRun = APISitesManager::getInstance()->getSitesIdFromTimezones($timezones);
        $websiteDayHasFinishedSinceLastRun = array_intersect($websiteDayHasFinishedSinceLastRun, $websiteIds);
        $this->websiteDayHasFinishedSinceLastRun = $websiteDayHasFinishedSinceLastRun;

        if (count($websiteDayHasFinishedSinceLastRun) > 0) {
            $ids = !empty($websiteDayHasFinishedSinceLastRun) ? ", IDs: " . implode(", ", $websiteDayHasFinishedSinceLastRun) : "";
            $this->logger->info("- Will process " . count($websiteDayHasFinishedSinceLastRun)
                . " other websites because the last time they were archived was on a different day (in the website's timezone) "
                . $ids);
        }

        return $websiteDayHasFinishedSinceLastRun;
    }
60381
public function getIndexes()
    {
        $query = $this->db->getQuery(true);
        $table = $this->db->replacePrefix($this->name);

        $query->select([
            'tbl.name AS table_name',
            'col.name AS column_name',
            'idx.name AS index_name',
            'col.*',
            'idx.*'
        ])
            ->from('sys.columns AS col')
            ->leftJoin(
                'sys.tables AS tbl',
                'col.object_id = tbl.object_id'
            )
            ->leftJoin(
                'sys.index_columns AS ic',
                'col.column_id = ic.column_id AND ic.object_id = tbl.object_id'
            )
            ->leftJoin(
                'sys.indexes AS idx',
                'idx.object_id = tbl.object_id AND idx.index_id = ic.index_id'
            )
            ->where('tbl.name = %q', $table)

            ->where('(idx.name IS NOT NULL OR col.is_identity = 1 OR idx.is_primary_key = 1)');

        $indexes = $this->db->prepare($query)->loadAll();

        $keys = [];

        foreach ($indexes as $index) {
            $key = new \stdClass();

            $key->Table = $table;
            $key->Is_primary = $index->is_primary_key ?: $index->is_identity;
            $key->Non_unique = !$index->is_unique;
            $key->Key_name = $key->Is_primary ? 'PRIMARY' : $index->index_name;
            $key->Column_name = $index->column_name;
            $key->Collation = 'A';
            $key->Cardinality = 0;
            $key->Sub_part = null;
            $key->Packed = null;
            $key->Null = null;
            $key->Index_type = 'BTREE';
            // TODO: Finish comments query
            $key->Comment = null;
            $key->Index_comment = null;
            $key->is_identity = $index->is_identity ? 'auto_increment' : '';

            $keys[] = $key;
        }

        return $keys;
    }
1322837
public function getIndexes( $oid )
    {

        // load primary keys
        $query = new Query(
            "SELECT string_to_array( indkey::text, ' ') AS keys, * FROM pg_index WHERE indrelid = %oid:int%",
            array( 'oid' => $this->get('oid') )
        );

        $indexes = $this->db->query( $query )->fetch(Result::TYPE_DETECT);

        foreach( $this->indexes as &$index ) {

            $index['columns'] = array();

            foreach( $index['keys'] as $columnIndex ) {
                $index['columns'][] = sprintf(
                    '%s.%s',
                    $oid,
                    $columnIndex
                );
            }

        }

        return $indexes;

    }
956793
public function findFolderTree($siteId)
    {
        $qa = $this->createAggregationQuery();
        $qa->match(array('siteId' => $siteId));
        $folders = $qa->getQuery()->aggregate()->toArray();

        if (empty($folders)) {
            return array();
        }

        $rootFolders = array_filter($folders, function($folder, $key) {
            if (isset($folder['parent'])) {
                return false;
            }
            return true;
        }, ARRAY_FILTER_USE_BOTH);

        $foldersToPlace = array_udiff($folders, $rootFolders, function($folder1, $folder2) {
            if ($folder1 === $folder2) {
                return 0;
            }
            return -1;
        });

        $tree = array();
        foreach ($rootFolders as $rootFolder) {
            $tree[] = array(
                'folder'   => $rootFolder,
                'children' => $this->getChildren($rootFolder, $foldersToPlace)
            );
        }

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

        return $this->getTreePerimeterConfiguration($treeFolders);
    }