Smile\ElasticsuiteVirtualCategory\Model\Rule::getChildrenVirtualCategories PHP Method

getChildrenVirtualCategories() private method

Returns the list of the virtual categories available under a category.
private getChildrenVirtualCategories ( Magento\Catalog\Api\Data\CategoryInterface $category, array $excludedCategories = [] ) : Magento\Catalog\Model\ResourceModel\Category\Collection;
$category Magento\Catalog\Api\Data\CategoryInterface Category.
$excludedCategories array Category already used into the building stack. Avoid short circuit.
return Magento\Catalog\Model\ResourceModel\Category\Collection;
    private function getChildrenVirtualCategories(CategoryInterface $category, $excludedCategories = [])
    {
        $storeId = $category->getStoreId();
        $categoryCollection = $this->categoryCollectionFactory->create()->setStoreId($storeId);
        $categoryCollection->addAttributeToFilter('is_virtual_category', 1)->addAttributeToFilter('is_active', ['neq' => 0])->addPathFilter(sprintf('%s/.*', $category->getPath()));
        if (!empty($excludedCategories)) {
            $categoryCollection->addAttributeToFilter('entity_id', ['nin' => $excludedCategories]);
        }
        $categoryCollection->addAttributeToSelect(['is_active', 'virtual_category_root', 'is_virtual_category', 'virtual_rule']);
        return $categoryCollection;
    }