Smile\ElasticsuiteThesaurus\Model\ResourceModel\Thesaurus\Collection::addStoreFilter PHP Method

addStoreFilter() public method

Filter collection by specified store ids
public addStoreFilter ( array | integer $storeIds )
$storeIds array | integer The store ids to filter
    public function addStoreFilter($storeIds)
    {
        $defaultStoreId = Store::DEFAULT_STORE_ID;
        if (!is_array($storeIds)) {
            $storeIds = [$storeIds];
        }
        if (!in_array($defaultStoreId, $storeIds)) {
            $storeIds[] = $defaultStoreId;
        }
        $this->getSelect()->join(['store_table' => $this->getTable(ThesaurusInterface::STORE_TABLE_NAME)], 'main_table.' . ThesaurusInterface::THESAURUS_ID . ' = store_table.' . ThesaurusInterface::THESAURUS_ID, [])->where('store_table.store_id IN (?)', $storeIds)->group('main_table.' . ThesaurusInterface::THESAURUS_ID);
        return $this;
    }