-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.2.x' of https://github.com/Smile-SA/elasticsuite into…
… 2.2.x
- Loading branch information
Showing
3 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
src/module-elasticsuite-virtual-category/Api/Data/VirtualRuleInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* DISCLAIMER | ||
* Do not edit or add to this file if you wish to upgrade Smile Elastic Suite to newer | ||
* versions in the future. | ||
* | ||
* @category Smile | ||
* @package Smile\ElasticsuiteVirtualCategory | ||
* @author Romain Ruaud <romain.ruaud@smile.fr> | ||
* @copyright 2016 Smile | ||
* @license Open Software License ("OSL") v. 3.0 | ||
*/ | ||
namespace Smile\ElasticsuiteVirtualCategory\Api\Data; | ||
|
||
use Magento\Catalog\Api\Data\CategoryInterface; | ||
|
||
/** | ||
* Virtual Category Rule Interface. | ||
* | ||
* @category Smile | ||
* @package Smile\ElasticsuiteVirtualCategory | ||
* @author Romain Ruaud <romain.ruaud@smile.fr> | ||
*/ | ||
interface VirtualRuleInterface | ||
{ | ||
/** | ||
* Build search query by category. | ||
* | ||
* @param CategoryInterface $category Search category. | ||
* @param array $excludedCategories Categories that should not be used into search query building. | ||
* Used to avoid infinite recursion while building virtual categories rules. | ||
* | ||
* @return \Smile\ElasticsuiteCore\Search\Request\QueryInterface | ||
*/ | ||
public function getCategorySearchQuery($category, $excludedCategories = []); | ||
|
||
/** | ||
* Retrieve search queries of children categories. | ||
* | ||
* @param CategoryInterface $rootCategory Root category. | ||
* | ||
* @return \Smile\ElasticsuiteCore\Search\Request\QueryInterface[] | ||
*/ | ||
public function getSearchQueriesByChildren(CategoryInterface $rootCategory); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/module-elasticsuite-virtual-category/etc/extension_attributes.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
/** | ||
* Smile_ElasticsuiteVirtualCategory Extension Attributes Configuration. | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade Smile Elastic Suite to newer | ||
* versions in the future. | ||
* | ||
* | ||
* @category Smile | ||
* @package Smile\ElasticsuiteVirtualCategory | ||
* @author Romain Ruaud <romain.ruaud@smile.fr> | ||
* @copyright 2016 Smile | ||
* @license Open Software License ("OSL") v. 3.0 | ||
*/ | ||
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> | ||
<extension_attributes for="Magento\Catalog\Api\Data\CategoryInterface"> | ||
<attribute code="virtual_rule" type="Smile\ElasticsuiteVirtualCategory\Api\Data\VirtualRuleInterface" /> | ||
</extension_attributes> | ||
</config> |