repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Analysis/Config/Converter.php | Converter.parseAnalyzers | private function parseAnalyzers(
\DOMXPath $xpath,
array $availableCharFilters,
array $availableFilters,
$language = 'default'
) {
$analyzers = [];
$languagePath = "@language='default'";
if ($language != 'default') {
$languagePath .= " or @langua... | php | private function parseAnalyzers(
\DOMXPath $xpath,
array $availableCharFilters,
array $availableFilters,
$language = 'default'
) {
$analyzers = [];
$languagePath = "@language='default'";
if ($language != 'default') {
$languagePath .= " or @langua... | [
"private",
"function",
"parseAnalyzers",
"(",
"\\",
"DOMXPath",
"$",
"xpath",
",",
"array",
"$",
"availableCharFilters",
",",
"array",
"$",
"availableFilters",
",",
"$",
"language",
"=",
"'default'",
")",
"{",
"$",
"analyzers",
"=",
"[",
"]",
";",
"$",
"la... | Analyzers parser by language.
@param \DOMXPath $xpath XPath access to the document parsed.
@param array $availableCharFilters List of available char filters.
@param array $availableFilters List of available filters.
@param string $language Language searched.
@return array | [
"Analyzers",
"parser",
"by",
"language",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Analysis/Config/Converter.php#L194-L243 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Analysis/Config/Converter.php | Converter.getFiltersByRef | private function getFiltersByRef(\DOMXPath $xpath, \DomNode $rootNode, $searchPath, array $availableFilters)
{
$filters = [];
$filterNodes = $xpath->query($searchPath, $rootNode);
foreach ($filterNodes as $filterNode) {
$filterName = $filterNode->getAttribute('ref');
... | php | private function getFiltersByRef(\DOMXPath $xpath, \DomNode $rootNode, $searchPath, array $availableFilters)
{
$filters = [];
$filterNodes = $xpath->query($searchPath, $rootNode);
foreach ($filterNodes as $filterNode) {
$filterName = $filterNode->getAttribute('ref');
... | [
"private",
"function",
"getFiltersByRef",
"(",
"\\",
"DOMXPath",
"$",
"xpath",
",",
"\\",
"DomNode",
"$",
"rootNode",
",",
"$",
"searchPath",
",",
"array",
"$",
"availableFilters",
")",
"{",
"$",
"filters",
"=",
"[",
"]",
";",
"$",
"filterNodes",
"=",
"$... | Return all filters under a root node filtered by an array of available filters.
@param \DOMXPath $xpath XPath access to the document parsed.
@param \DomNode $rootNode Search root node.
@param string $searchPath Filters search path.
@param array $availableFilters List of available filte... | [
"Return",
"all",
"filters",
"under",
"a",
"root",
"node",
"filtered",
"by",
"an",
"array",
"of",
"available",
"filters",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Analysis/Config/Converter.php#L254-L267 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Category/Filter/Provider.php | Provider.getCategorySearchQuery | private function getCategorySearchQuery(CategoryInterface $category)
{
$virtualRule = $category->getVirtualRule();
if (!($virtualRule instanceof VirtualRuleInterface)) {
return $this->loadVirtualRule($category)->getCategorySearchQuery($category);
}
return $this->helper->... | php | private function getCategorySearchQuery(CategoryInterface $category)
{
$virtualRule = $category->getVirtualRule();
if (!($virtualRule instanceof VirtualRuleInterface)) {
return $this->loadVirtualRule($category)->getCategorySearchQuery($category);
}
return $this->helper->... | [
"private",
"function",
"getCategorySearchQuery",
"(",
"CategoryInterface",
"$",
"category",
")",
"{",
"$",
"virtualRule",
"=",
"$",
"category",
"->",
"getVirtualRule",
"(",
")",
";",
"if",
"(",
"!",
"(",
"$",
"virtualRule",
"instanceof",
"VirtualRuleInterface",
... | Get category search query
@param \Magento\Catalog\Api\Data\CategoryInterface $category Category
@return \Smile\ElasticsuiteCore\Search\Request\QueryInterface | [
"Get",
"category",
"search",
"query"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Category/Filter/Provider.php#L80-L88 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Model/Rule.php | Rule.getConditionsInstance | public function getConditionsInstance()
{
$condition = $this->conditionsFactory->create();
$condition->setRule($this);
$condition->setElementName($this->elementName);
return $condition;
} | php | public function getConditionsInstance()
{
$condition = $this->conditionsFactory->create();
$condition->setRule($this);
$condition->setElementName($this->elementName);
return $condition;
} | [
"public",
"function",
"getConditionsInstance",
"(",
")",
"{",
"$",
"condition",
"=",
"$",
"this",
"->",
"conditionsFactory",
"->",
"create",
"(",
")",
";",
"$",
"condition",
"->",
"setRule",
"(",
"$",
"this",
")",
";",
"$",
"condition",
"->",
"setElementNa... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Model/Rule.php#L71-L78 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Model/Rule.php | Rule.getConditions | public function getConditions()
{
$conditions = parent::getConditions();
$conditions->setRule($this);
$conditions->setElementName($this->elementName);
return $conditions;
} | php | public function getConditions()
{
$conditions = parent::getConditions();
$conditions->setRule($this);
$conditions->setElementName($this->elementName);
return $conditions;
} | [
"public",
"function",
"getConditions",
"(",
")",
"{",
"$",
"conditions",
"=",
"parent",
"::",
"getConditions",
"(",
")",
";",
"$",
"conditions",
"->",
"setRule",
"(",
"$",
"this",
")",
";",
"$",
"conditions",
"->",
"setElementName",
"(",
"$",
"this",
"->... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Model/Rule.php#L105-L112 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Model/Rule.php | Rule.getSearchQuery | public function getSearchQuery()
{
$query = null;
$conditions = $this->getConditions();
if ($conditions) {
$query = $conditions->getSearchQuery();
}
return $query;
} | php | public function getSearchQuery()
{
$query = null;
$conditions = $this->getConditions();
if ($conditions) {
$query = $conditions->getSearchQuery();
}
return $query;
} | [
"public",
"function",
"getSearchQuery",
"(",
")",
"{",
"$",
"query",
"=",
"null",
";",
"$",
"conditions",
"=",
"$",
"this",
"->",
"getConditions",
"(",
")",
";",
"if",
"(",
"$",
"conditions",
")",
"{",
"$",
"query",
"=",
"$",
"conditions",
"->",
"get... | Build a search query for the current rule.
@return QueryInterface | [
"Build",
"a",
"search",
"query",
"for",
"the",
"current",
"rule",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Model/Rule.php#L119-L129 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Model/Rule.php | Rule.arrayToConditionDataModel | protected function arrayToConditionDataModel(array $input)
{
/** @var \Smile\ElasticsuiteCatalogRule\Model\Data\Condition $conditionDataModel */
$conditionDataModel = $this->conditionDataFactory->create();
foreach ($input as $key => $value) {
switch ($key) {
case ... | php | protected function arrayToConditionDataModel(array $input)
{
/** @var \Smile\ElasticsuiteCatalogRule\Model\Data\Condition $conditionDataModel */
$conditionDataModel = $this->conditionDataFactory->create();
foreach ($input as $key => $value) {
switch ($key) {
case ... | [
"protected",
"function",
"arrayToConditionDataModel",
"(",
"array",
"$",
"input",
")",
"{",
"/** @var \\Smile\\ElasticsuiteCatalogRule\\Model\\Data\\Condition $conditionDataModel */",
"$",
"conditionDataModel",
"=",
"$",
"this",
"->",
"conditionDataFactory",
"->",
"create",
"("... | Convert recursive array into condition data model
@param array $input Conditions arrays.
@return \Smile\ElasticsuiteCatalogRule\Model\Data\Condition | [
"Convert",
"recursive",
"array",
"into",
"condition",
"data",
"model"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Model/Rule.php#L138-L171 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Model/Rule.php | Rule.dataModelToArray | protected function dataModelToArray(\Smile\ElasticsuiteCatalogRule\Model\Data\Condition $condition, $key = 'conditions')
{
$output = [];
$output['type'] = $condition->getConditionType();
$output['value'] = $condition->getValue();
$output['attribute'] = $conditio... | php | protected function dataModelToArray(\Smile\ElasticsuiteCatalogRule\Model\Data\Condition $condition, $key = 'conditions')
{
$output = [];
$output['type'] = $condition->getConditionType();
$output['value'] = $condition->getValue();
$output['attribute'] = $conditio... | [
"protected",
"function",
"dataModelToArray",
"(",
"\\",
"Smile",
"\\",
"ElasticsuiteCatalogRule",
"\\",
"Model",
"\\",
"Data",
"\\",
"Condition",
"$",
"condition",
",",
"$",
"key",
"=",
"'conditions'",
")",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"$",
"out... | Convert recursive array into condition data model
@param \Smile\ElasticsuiteCatalogRule\Model\Data\Condition $condition The condition
@param string $key The key
@return array | [
"Convert",
"recursive",
"array",
"into",
"condition",
"data",
"model"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Model/Rule.php#L181-L201 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Setup/OptimizerSetup.php | OptimizerSetup.createOptimizerTable | public function createOptimizerTable(SchemaSetupInterface $setup)
{
if (!$setup->getConnection()->isTableExists($setup->getTable(OptimizerInterface::TABLE_NAME))) {
$table = $setup->getConnection()
->newTable($setup->getTable(OptimizerInterface::TABLE_NAME))
->add... | php | public function createOptimizerTable(SchemaSetupInterface $setup)
{
if (!$setup->getConnection()->isTableExists($setup->getTable(OptimizerInterface::TABLE_NAME))) {
$table = $setup->getConnection()
->newTable($setup->getTable(OptimizerInterface::TABLE_NAME))
->add... | [
"public",
"function",
"createOptimizerTable",
"(",
"SchemaSetupInterface",
"$",
"setup",
")",
"{",
"if",
"(",
"!",
"$",
"setup",
"->",
"getConnection",
"(",
")",
"->",
"isTableExists",
"(",
"$",
"setup",
"->",
"getTable",
"(",
"OptimizerInterface",
"::",
"TABL... | Create Optimizer main table.
@param \Magento\Framework\Setup\SchemaSetupInterface $setup Setup instance | [
"Create",
"Optimizer",
"main",
"table",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Setup/OptimizerSetup.php#L57-L129 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Setup/OptimizerSetup.php | OptimizerSetup.createOptimizerSearchContainerTable | public function createOptimizerSearchContainerTable(SchemaSetupInterface $setup)
{
if (!$setup->getConnection()->isTableExists($setup->getTable(OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER))) {
$table = $setup->getConnection()
->newTable($setup->getTable(OptimizerInterface::TA... | php | public function createOptimizerSearchContainerTable(SchemaSetupInterface $setup)
{
if (!$setup->getConnection()->isTableExists($setup->getTable(OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER))) {
$table = $setup->getConnection()
->newTable($setup->getTable(OptimizerInterface::TA... | [
"public",
"function",
"createOptimizerSearchContainerTable",
"(",
"SchemaSetupInterface",
"$",
"setup",
")",
"{",
"if",
"(",
"!",
"$",
"setup",
"->",
"getConnection",
"(",
")",
"->",
"isTableExists",
"(",
"$",
"setup",
"->",
"getTable",
"(",
"OptimizerInterface",
... | Create Optimizer Query table.
@param \Magento\Framework\Setup\SchemaSetupInterface $setup Setup instance | [
"Create",
"Optimizer",
"Query",
"table",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Setup/OptimizerSetup.php#L136-L182 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Setup/OptimizerSetup.php | OptimizerSetup.updateOptimizerSearchContainerTable | public function updateOptimizerSearchContainerTable(SchemaSetupInterface $setup)
{
$setup->getConnection()
->addColumn(
$setup->getTable(OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER),
'apply_to',
[
'type' => \Magento\Fram... | php | public function updateOptimizerSearchContainerTable(SchemaSetupInterface $setup)
{
$setup->getConnection()
->addColumn(
$setup->getTable(OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER),
'apply_to',
[
'type' => \Magento\Fram... | [
"public",
"function",
"updateOptimizerSearchContainerTable",
"(",
"SchemaSetupInterface",
"$",
"setup",
")",
"{",
"$",
"setup",
"->",
"getConnection",
"(",
")",
"->",
"addColumn",
"(",
"$",
"setup",
"->",
"getTable",
"(",
"OptimizerInterface",
"::",
"TABLE_NAME_SEAR... | Adding "apply_to" column to smile_elasticsuite_optimizer_search_container table
@param \Magento\Framework\Setup\SchemaSetupInterface $setup Setup instance | [
"Adding",
"apply_to",
"column",
"to",
"smile_elasticsuite_optimizer_search_container",
"table"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Setup/OptimizerSetup.php#L189-L202 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Setup/OptimizerSetup.php | OptimizerSetup.createOptimizerLimitationTable | public function createOptimizerLimitationTable(SchemaSetupInterface $setup)
{
if (!$setup->getConnection()->isTableExists($setup->getTable(OptimizerInterface::TABLE_NAME_LIMITATION))) {
$categoryIdField = $this->metadataPool->getMetadata(\Magento\Catalog\Api\Data\CategoryInterface::class)->getId... | php | public function createOptimizerLimitationTable(SchemaSetupInterface $setup)
{
if (!$setup->getConnection()->isTableExists($setup->getTable(OptimizerInterface::TABLE_NAME_LIMITATION))) {
$categoryIdField = $this->metadataPool->getMetadata(\Magento\Catalog\Api\Data\CategoryInterface::class)->getId... | [
"public",
"function",
"createOptimizerLimitationTable",
"(",
"SchemaSetupInterface",
"$",
"setup",
")",
"{",
"if",
"(",
"!",
"$",
"setup",
"->",
"getConnection",
"(",
")",
"->",
"isTableExists",
"(",
"$",
"setup",
"->",
"getTable",
"(",
"OptimizerInterface",
"::... | Create table containing entity association between optimizer and category_id or search_terms.
@param \Magento\Framework\Setup\SchemaSetupInterface $setup Setup instance | [
"Create",
"table",
"containing",
"entity",
"association",
"between",
"optimizer",
"and",
"category_id",
"or",
"search_terms",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Setup/OptimizerSetup.php#L209-L281 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Setup/OptimizerSetup.php | OptimizerSetup.convertSerializedRulesToJson | public function convertSerializedRulesToJson(\Magento\Setup\Module\DataSetup $setup)
{
$fieldDataConverter = $this->fieldDataConverterFactory->create(
\Magento\Framework\DB\DataConverter\SerializedToJson::class
);
$fieldDataConverter->convert(
$setup->getConnection()... | php | public function convertSerializedRulesToJson(\Magento\Setup\Module\DataSetup $setup)
{
$fieldDataConverter = $this->fieldDataConverterFactory->create(
\Magento\Framework\DB\DataConverter\SerializedToJson::class
);
$fieldDataConverter->convert(
$setup->getConnection()... | [
"public",
"function",
"convertSerializedRulesToJson",
"(",
"\\",
"Magento",
"\\",
"Setup",
"\\",
"Module",
"\\",
"DataSetup",
"$",
"setup",
")",
"{",
"$",
"fieldDataConverter",
"=",
"$",
"this",
"->",
"fieldDataConverterFactory",
"->",
"create",
"(",
"\\",
"Mage... | Upgrade legacy serialized data to JSON data.
Targets :
- columns "config" and "rule_condition" of the smile_elasticsuite_optimizer table.
@param \Magento\Setup\Module\DataSetup $setup Setup
@return void | [
"Upgrade",
"legacy",
"serialized",
"data",
"to",
"JSON",
"data",
".",
"Targets",
":",
"-",
"columns",
"config",
"and",
"rule_condition",
"of",
"the",
"smile_elasticsuite_optimizer",
"table",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Setup/OptimizerSetup.php#L292-L311 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer.php | Optimizer.getSearchContainersFromOptimizerId | public function getSearchContainersFromOptimizerId($optimizerId)
{
$connection = $this->getConnection();
$select = $connection->select();
$select->from(
$this->getTable(OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER),
[OptimizerInterface::SEARCH_CONTAINER, 'apply_t... | php | public function getSearchContainersFromOptimizerId($optimizerId)
{
$connection = $this->getConnection();
$select = $connection->select();
$select->from(
$this->getTable(OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER),
[OptimizerInterface::SEARCH_CONTAINER, 'apply_t... | [
"public",
"function",
"getSearchContainersFromOptimizerId",
"(",
"$",
"optimizerId",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"$",
"select",
"=",
"$",
"connection",
"->",
"select",
"(",
")",
";",
"$",
"select",
"... | Retrieve Search Containers for a given optimizer.
@param int $optimizerId The optimizer Id
@return array | [
"Retrieve",
"Search",
"Containers",
"for",
"a",
"given",
"optimizer",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer.php#L59-L71 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer.php | Optimizer._afterSave | protected function _afterSave(\Magento\Framework\Model\AbstractModel $object)
{
parent::_afterSave($object);
$this->saveSearchContainerRelation($object);
return $this;
} | php | protected function _afterSave(\Magento\Framework\Model\AbstractModel $object)
{
parent::_afterSave($object);
$this->saveSearchContainerRelation($object);
return $this;
} | [
"protected",
"function",
"_afterSave",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Model",
"\\",
"AbstractModel",
"$",
"object",
")",
"{",
"parent",
"::",
"_afterSave",
"(",
"$",
"object",
")",
";",
"$",
"this",
"->",
"saveSearchContainerRelation",
"(",
... | @SuppressWarnings(PHPMD.CamelCaseMethodName)
{@inheritDoc} | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"CamelCaseMethodName",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer.php#L88-L95 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer.php | Optimizer._afterLoad | protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
if ($object->getId()) {
$searchContainers = $this->getSearchContainersFromOptimizerId($object->getId());
$object->setSearchContainers($searchContainers);
}
/* Using getter to force unser... | php | protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
if ($object->getId()) {
$searchContainers = $this->getSearchContainersFromOptimizerId($object->getId());
$object->setSearchContainers($searchContainers);
}
/* Using getter to force unser... | [
"protected",
"function",
"_afterLoad",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Model",
"\\",
"AbstractModel",
"$",
"object",
")",
"{",
"if",
"(",
"$",
"object",
"->",
"getId",
"(",
")",
")",
"{",
"$",
"searchContainers",
"=",
"$",
"this",
"->",
... | @SuppressWarnings(PHPMD.CamelCaseMethodName)
{@inheritDoc} | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"CamelCaseMethodName",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer.php#L102-L114 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer.php | Optimizer._beforeSave | protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object)
{
if (is_array($object->getConfig())) {
$object->setConfig($this->serializer->serialize($object->getConfig()));
}
$rule = $this->ruleFactory->create();
$ruleCondition = $object->getRuleConditi... | php | protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object)
{
if (is_array($object->getConfig())) {
$object->setConfig($this->serializer->serialize($object->getConfig()));
}
$rule = $this->ruleFactory->create();
$ruleCondition = $object->getRuleConditi... | [
"protected",
"function",
"_beforeSave",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Model",
"\\",
"AbstractModel",
"$",
"object",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"object",
"->",
"getConfig",
"(",
")",
")",
")",
"{",
"$",
"object",
"->",
... | @SuppressWarnings(PHPMD.CamelCaseMethodName)
{@inheritDoc} | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"CamelCaseMethodName",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer.php#L121-L138 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer.php | Optimizer.saveSearchContainerRelation | private function saveSearchContainerRelation(\Magento\Framework\Model\AbstractModel $object)
{
$searchContainers = $object->getSearchContainer();
if (is_array($searchContainers) && (count($searchContainers) > 0)) {
$searchContainerLinks = [];
$deleteCondition = OptimizerInte... | php | private function saveSearchContainerRelation(\Magento\Framework\Model\AbstractModel $object)
{
$searchContainers = $object->getSearchContainer();
if (is_array($searchContainers) && (count($searchContainers) > 0)) {
$searchContainerLinks = [];
$deleteCondition = OptimizerInte... | [
"private",
"function",
"saveSearchContainerRelation",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Model",
"\\",
"AbstractModel",
"$",
"object",
")",
"{",
"$",
"searchContainers",
"=",
"$",
"object",
"->",
"getSearchContainer",
"(",
")",
";",
"if",
"(",
"is... | Saves relation between optimizer and search container
@param \Magento\Framework\Model\AbstractModel $object Optimizer to save
@return void | [
"Saves",
"relation",
"between",
"optimizer",
"and",
"search",
"container"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer.php#L147-L176 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Category/AttributeList.php | AttributeList.getList | public function getList()
{
/** @var $collection \Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\FilterableAttribute\Category\Collection */
$collection = $this->collectionFactory->create();
$collection->setItemObjectClass(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class)
... | php | public function getList()
{
/** @var $collection \Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\FilterableAttribute\Category\Collection */
$collection = $this->collectionFactory->create();
$collection->setItemObjectClass(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class)
... | [
"public",
"function",
"getList",
"(",
")",
"{",
"/** @var $collection \\Smile\\ElasticsuiteCatalog\\Model\\ResourceModel\\Product\\FilterableAttribute\\Category\\Collection */",
"$",
"collection",
"=",
"$",
"this",
"->",
"collectionFactory",
"->",
"create",
"(",
")",
";",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Category/AttributeList.php#L56-L76 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Model/EventQueue.php | EventQueue.addEvent | public function addEvent($eventData)
{
foreach ($this->processors as $processor) {
$eventData = $processor->process($eventData);
}
$this->resourceModel->saveEvent($eventData);
} | php | public function addEvent($eventData)
{
foreach ($this->processors as $processor) {
$eventData = $processor->process($eventData);
}
$this->resourceModel->saveEvent($eventData);
} | [
"public",
"function",
"addEvent",
"(",
"$",
"eventData",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"processors",
"as",
"$",
"processor",
")",
"{",
"$",
"eventData",
"=",
"$",
"processor",
"->",
"process",
"(",
"$",
"eventData",
")",
";",
"}",
"$",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/EventQueue.php#L55-L62 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/ResourceModel/Search/Request/RelevanceConfig/Data.php | Data._checkUnique | protected function _checkUnique(\Magento\Framework\Model\AbstractModel $object)
{
$select = $this->getConnection()->select()->from(
$this->getMainTable(),
[$this->getIdFieldName()]
)->where(
'scope = :scope'
)->where(
'scope_code = :scope_code'... | php | protected function _checkUnique(\Magento\Framework\Model\AbstractModel $object)
{
$select = $this->getConnection()->select()->from(
$this->getMainTable(),
[$this->getIdFieldName()]
)->where(
'scope = :scope'
)->where(
'scope_code = :scope_code'... | [
"protected",
"function",
"_checkUnique",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Model",
"\\",
"AbstractModel",
"$",
"object",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"select",
"(",
")",
"->",
"from",
"("... | Validate unique configuration data before save
Set id to object if exists configuration instead of throw exception
@SuppressWarnings(PHPMD.CamelCaseMethodName)
@param \Magento\Framework\Model\AbstractModel $object The current configuration value being saved
@return $this | [
"Validate",
"unique",
"configuration",
"data",
"before",
"save",
"Set",
"id",
"to",
"object",
"if",
"exists",
"configuration",
"instead",
"of",
"throw",
"exception"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/ResourceModel/Search/Request/RelevanceConfig/Data.php#L48-L72 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form/Field.php | Field._isInheritCheckboxRequired | protected function _isInheritCheckboxRequired(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
return $element->getCanUseContainerValue() || $element->getCanUseDefaultValue();
} | php | protected function _isInheritCheckboxRequired(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
return $element->getCanUseContainerValue() || $element->getCanUseDefaultValue();
} | [
"protected",
"function",
"_isInheritCheckboxRequired",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Data",
"\\",
"Form",
"\\",
"Element",
"\\",
"AbstractElement",
"$",
"element",
")",
"{",
"return",
"$",
"element",
"->",
"getCanUseContainerValue",
"(",
")",
"... | Check if inheritance checkbox has to be rendered
@SuppressWarnings(PHPMD.CamelCaseMethodName)
@param \Magento\Framework\Data\Form\Element\AbstractElement $element The form element
@return bool | [
"Check",
"if",
"inheritance",
"checkbox",
"has",
"to",
"be",
"rendered"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form/Field.php#L34-L37 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form/Field.php | Field._getInheritCheckboxLabel | protected function _getInheritCheckboxLabel(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$checkboxLabel = __('Use Default');
if ($element->getCanUseContainerValue()) {
$checkboxLabel = __('Use Container');
}
return $checkboxLabel;
} | php | protected function _getInheritCheckboxLabel(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
$checkboxLabel = __('Use Default');
if ($element->getCanUseContainerValue()) {
$checkboxLabel = __('Use Container');
}
return $checkboxLabel;
} | [
"protected",
"function",
"_getInheritCheckboxLabel",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Data",
"\\",
"Form",
"\\",
"Element",
"\\",
"AbstractElement",
"$",
"element",
")",
"{",
"$",
"checkboxLabel",
"=",
"__",
"(",
"'Use Default'",
")",
";",
"if",... | Retrieve label for the inheritance checkbox
@SuppressWarnings(PHPMD.CamelCaseMethodName)
@param \Magento\Framework\Data\Form\Element\AbstractElement $element The form element
@return string | [
"Retrieve",
"label",
"for",
"the",
"inheritance",
"checkbox"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form/Field.php#L48-L56 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Plugin/Catalog/Category/ChooserPlugin.php | ChooserPlugin.aroundExecute | public function aroundExecute(
\Magento\CatalogRule\Controller\Adminhtml\Promo\Widget\Chooser $controller,
\Closure $proceed
) {
// Exit if we are not building a category chooser.
if ($controller->getRequest()->getParam('attribute') !== 'category_ids') {
return $proceed()... | php | public function aroundExecute(
\Magento\CatalogRule\Controller\Adminhtml\Promo\Widget\Chooser $controller,
\Closure $proceed
) {
// Exit if we are not building a category chooser.
if ($controller->getRequest()->getParam('attribute') !== 'category_ids') {
return $proceed()... | [
"public",
"function",
"aroundExecute",
"(",
"\\",
"Magento",
"\\",
"CatalogRule",
"\\",
"Controller",
"\\",
"Adminhtml",
"\\",
"Promo",
"\\",
"Widget",
"\\",
"Chooser",
"$",
"controller",
",",
"\\",
"Closure",
"$",
"proceed",
")",
"{",
"// Exit if we are not bui... | Plugin on execute() function of the category chooser controller.
Done via a plugin instead of layout because legacy controller is already creating block via getLayout()->createBlock().
@param \Magento\CatalogRule\Controller\Adminhtml\Promo\Widget\Chooser $controller The controller
@param \Closure ... | [
"Plugin",
"on",
"execute",
"()",
"function",
"of",
"the",
"category",
"chooser",
"controller",
".",
"Done",
"via",
"a",
"plugin",
"instead",
"of",
"layout",
"because",
"legacy",
"controller",
"is",
"already",
"creating",
"block",
"via",
"getLayout",
"()",
"-",... | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Plugin/Catalog/Category/ChooserPlugin.php#L60-L91 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Plugin/Catalog/Category/ChooserPlugin.php | ChooserPlugin.getIds | private function getIds($controller)
{
$ids = $controller->getRequest()->getParam('selected', []);
if (!is_array($ids)) {
$ids = [];
}
foreach ($ids as $key => &$id) {
$id = (int) $id;
if ($id <= 0) {
unset($ids[$key]);
... | php | private function getIds($controller)
{
$ids = $controller->getRequest()->getParam('selected', []);
if (!is_array($ids)) {
$ids = [];
}
foreach ($ids as $key => &$id) {
$id = (int) $id;
if ($id <= 0) {
unset($ids[$key]);
... | [
"private",
"function",
"getIds",
"(",
"$",
"controller",
")",
"{",
"$",
"ids",
"=",
"$",
"controller",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",
"'selected'",
",",
"[",
"]",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"ids",
")",
")"... | Retrieve currently selected Ids.
@param \Magento\Backend\App\Action $controller The controller
@return array | [
"Retrieve",
"currently",
"selected",
"Ids",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Plugin/Catalog/Category/ChooserPlugin.php#L100-L116 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/SearchTerms.php | SearchTerms.getTermsData | public function getTermsData()
{
$data = [];
try {
$data = $this->getReport()->getData();
} catch (\LogicException $e) {
;
}
foreach ($data as &$value) {
$value['url'] = $this->getMerchandiserUrl($value['term']);
}
return... | php | public function getTermsData()
{
$data = [];
try {
$data = $this->getReport()->getData();
} catch (\LogicException $e) {
;
}
foreach ($data as &$value) {
$value['url'] = $this->getMerchandiserUrl($value['term']);
}
return... | [
"public",
"function",
"getTermsData",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"try",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getReport",
"(",
")",
"->",
"getData",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"LogicException",
"$",
"e",
")"... | Get terms data from the report.
@return mixed | [
"Get",
"terms",
"data",
"from",
"the",
"report",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/SearchTerms.php#L54-L69 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/SearchTerms.php | SearchTerms.getMerchandiserUrl | private function getMerchandiserUrl($term)
{
$url = null;
$query = $this->queryFactory->create();
$query->loadByQueryText($term);
if ($query->getId()) {
$url = $this->getUrl('search/term/edit', ['id' => $query->getId()]);
}
return $url;
} | php | private function getMerchandiserUrl($term)
{
$url = null;
$query = $this->queryFactory->create();
$query->loadByQueryText($term);
if ($query->getId()) {
$url = $this->getUrl('search/term/edit', ['id' => $query->getId()]);
}
return $url;
} | [
"private",
"function",
"getMerchandiserUrl",
"(",
"$",
"term",
")",
"{",
"$",
"url",
"=",
"null",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"queryFactory",
"->",
"create",
"(",
")",
";",
"$",
"query",
"->",
"loadByQueryText",
"(",
"$",
"term",
")",
... | Get the term merchandiser URL for a given search term.
@param string $term Search term.
@return null|string | [
"Get",
"the",
"term",
"merchandiser",
"URL",
"for",
"a",
"given",
"search",
"term",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/SearchTerms.php#L88-L99 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Product/Search/Request/Container/Filter/VisibleInSearch.php | VisibleInSearch.getFilterQuery | public function getFilterQuery()
{
$query = $this->queryFactory->create(
QueryInterface::TYPE_TERMS,
[
'field' => 'visibility',
'values' => [
\Magento\Catalog\Model\Product\Visibility::VISIBILITY_IN_SEARCH,
\Mage... | php | public function getFilterQuery()
{
$query = $this->queryFactory->create(
QueryInterface::TYPE_TERMS,
[
'field' => 'visibility',
'values' => [
\Magento\Catalog\Model\Product\Visibility::VISIBILITY_IN_SEARCH,
\Mage... | [
"public",
"function",
"getFilterQuery",
"(",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"queryFactory",
"->",
"create",
"(",
"QueryInterface",
"::",
"TYPE_TERMS",
",",
"[",
"'field'",
"=>",
"'visibility'",
",",
"'values'",
"=>",
"[",
"\\",
"Magento",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Search/Request/Container/Filter/VisibleInSearch.php#L46-L60 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/AttributeList.php | AttributeList.getAttributeCollection | public function getAttributeCollection()
{
if ($this->attributeCollection === null) {
$this->attributeCollection = $this->attributeCollectionFactory->create();
$attributeNameMapping = array_flip($this->fieldNameMapping);
$arrayNameCb = function (FieldInterface $fiel... | php | public function getAttributeCollection()
{
if ($this->attributeCollection === null) {
$this->attributeCollection = $this->attributeCollectionFactory->create();
$attributeNameMapping = array_flip($this->fieldNameMapping);
$arrayNameCb = function (FieldInterface $fiel... | [
"public",
"function",
"getAttributeCollection",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"attributeCollection",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"attributeCollection",
"=",
"$",
"this",
"->",
"attributeCollectionFactory",
"->",
"create",
"(",
")... | Retrieve attribute collection prefiltered with only attribute usable in rules.
@return \Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection | [
"Retrieve",
"attribute",
"collection",
"prefiltered",
"with",
"only",
"attribute",
"usable",
"in",
"rules",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/AttributeList.php#L111-L134 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/AttributeList.php | AttributeList.getField | public function getField($attributeName)
{
if (isset($this->fieldNameMapping[$attributeName])) {
$attributeName = $this->fieldNameMapping[$attributeName];
}
return $this->getMapping()->getField($attributeName);
} | php | public function getField($attributeName)
{
if (isset($this->fieldNameMapping[$attributeName])) {
$attributeName = $this->fieldNameMapping[$attributeName];
}
return $this->getMapping()->getField($attributeName);
} | [
"public",
"function",
"getField",
"(",
"$",
"attributeName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"fieldNameMapping",
"[",
"$",
"attributeName",
"]",
")",
")",
"{",
"$",
"attributeName",
"=",
"$",
"this",
"->",
"fieldNameMapping",
"[",
"... | Retrieve the mapping field for the rule attribute.
@param string $attributeName Attribute code.
@return \Smile\ElasticsuiteCore\Api\Index\Mapping\FieldInterface | [
"Retrieve",
"the",
"mapping",
"field",
"for",
"the",
"rule",
"attribute",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/AttributeList.php#L143-L150 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/AttributeList.php | AttributeList.getMapping | private function getMapping()
{
if ($this->mapping === null) {
$defaultStore = $this->getDefaultStoreView();
$index = $this->indexManager->getIndexByName($this->indexName, $defaultStore);
$this->mapping = $index->getMapping();
}
return $this->mapp... | php | private function getMapping()
{
if ($this->mapping === null) {
$defaultStore = $this->getDefaultStoreView();
$index = $this->indexManager->getIndexByName($this->indexName, $defaultStore);
$this->mapping = $index->getMapping();
}
return $this->mapp... | [
"private",
"function",
"getMapping",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"mapping",
"===",
"null",
")",
"{",
"$",
"defaultStore",
"=",
"$",
"this",
"->",
"getDefaultStoreView",
"(",
")",
";",
"$",
"index",
"=",
"$",
"this",
"->",
"indexManager... | Retrieve the search engine mapping.
@return MappingInterface | [
"Retrieve",
"the",
"search",
"engine",
"mapping",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/AttributeList.php#L157-L167 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/AttributeList.php | AttributeList.getDefaultStoreView | private function getDefaultStoreView()
{
$store = $this->storeManager->getDefaultStoreView();
if (null === $store) {
// Occurs when current user does not have access to default website (due to AdminGWS ACLS on Magento EE).
$store = current($this->storeManager->getWebsites())-... | php | private function getDefaultStoreView()
{
$store = $this->storeManager->getDefaultStoreView();
if (null === $store) {
// Occurs when current user does not have access to default website (due to AdminGWS ACLS on Magento EE).
$store = current($this->storeManager->getWebsites())-... | [
"private",
"function",
"getDefaultStoreView",
"(",
")",
"{",
"$",
"store",
"=",
"$",
"this",
"->",
"storeManager",
"->",
"getDefaultStoreView",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"store",
")",
"{",
"// Occurs when current user does not have access to de... | Retrieve default Store View
@return \Magento\Store\Api\Data\StoreInterface | [
"Retrieve",
"default",
"Store",
"View"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/AttributeList.php#L174-L183 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Autocomplete/Product/Collection/Filter.php | Filter.prepareCollection | public function prepareCollection(ProductCollection $collection)
{
$terms = $this->getQueryText();
$collection->setSearchQuery($terms);
return $collection;
} | php | public function prepareCollection(ProductCollection $collection)
{
$terms = $this->getQueryText();
$collection->setSearchQuery($terms);
return $collection;
} | [
"public",
"function",
"prepareCollection",
"(",
"ProductCollection",
"$",
"collection",
")",
"{",
"$",
"terms",
"=",
"$",
"this",
"->",
"getQueryText",
"(",
")",
";",
"$",
"collection",
"->",
"setSearchQuery",
"(",
"$",
"terms",
")",
";",
"return",
"$",
"c... | Append filters to the product list :
- Search query filter
@param ProductCollection $collection Product collection.
@return ProductCollection | [
"Append",
"filters",
"to",
"the",
"product",
"list",
":",
"-",
"Search",
"query",
"filter"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Product/Collection/Filter.php#L62-L69 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Autocomplete/Product/Collection/Filter.php | Filter.getQueryText | private function getQueryText()
{
$terms = array_map(
function (TermItem $termItem) {
return $termItem->getTitle();
},
$this->termDataProvider->getItems()
);
if (empty($terms)) {
$terms = [$this->queryFactory->get()->getQueryTe... | php | private function getQueryText()
{
$terms = array_map(
function (TermItem $termItem) {
return $termItem->getTitle();
},
$this->termDataProvider->getItems()
);
if (empty($terms)) {
$terms = [$this->queryFactory->get()->getQueryTe... | [
"private",
"function",
"getQueryText",
"(",
")",
"{",
"$",
"terms",
"=",
"array_map",
"(",
"function",
"(",
"TermItem",
"$",
"termItem",
")",
"{",
"return",
"$",
"termItem",
"->",
"getTitle",
"(",
")",
";",
"}",
",",
"$",
"this",
"->",
"termDataProvider"... | List of search terms suggested by the search terms data provider.
@return array | [
"List",
"of",
"search",
"terms",
"suggested",
"by",
"the",
"search",
"terms",
"data",
"provider",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Product/Collection/Filter.php#L76-L90 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/ScopeDefiner.php | ScopeDefiner.getScope | public function getScope()
{
return $this->request->getParam(
'store'
) ? ContainerScopeInterface::SCOPE_STORE_CONTAINERS : ($this->request->getParam(
'container'
) ? ContainerScopeInterface::SCOPE_CONTAINERS : ContainerScopeInterface::SCOPE_DEFAULT);
} | php | public function getScope()
{
return $this->request->getParam(
'store'
) ? ContainerScopeInterface::SCOPE_STORE_CONTAINERS : ($this->request->getParam(
'container'
) ? ContainerScopeInterface::SCOPE_CONTAINERS : ContainerScopeInterface::SCOPE_DEFAULT);
} | [
"public",
"function",
"getScope",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"request",
"->",
"getParam",
"(",
"'store'",
")",
"?",
"ContainerScopeInterface",
"::",
"SCOPE_STORE_CONTAINERS",
":",
"(",
"$",
"this",
"->",
"request",
"->",
"getParam",
"(",
"'c... | Retrieve current config scope
@return string | [
"Retrieve",
"current",
"config",
"scope"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/ScopeDefiner.php#L48-L55 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Indices/Config/Converter.php | Converter.convert | public function convert($source)
{
$indices = [];
$xpath = new \DOMXPath($source);
$indexSearchPath = sprintf("/%s/%s", self::ROOT_NODE_NAME, self::INDEX_NODE_TYPE);
foreach ($xpath->query($indexSearchPath) as $indexNode) {
$indexIdentifier = $indexNode->getAttribute('i... | php | public function convert($source)
{
$indices = [];
$xpath = new \DOMXPath($source);
$indexSearchPath = sprintf("/%s/%s", self::ROOT_NODE_NAME, self::INDEX_NODE_TYPE);
foreach ($xpath->query($indexSearchPath) as $indexNode) {
$indexIdentifier = $indexNode->getAttribute('i... | [
"public",
"function",
"convert",
"(",
"$",
"source",
")",
"{",
"$",
"indices",
"=",
"[",
"]",
";",
"$",
"xpath",
"=",
"new",
"\\",
"DOMXPath",
"(",
"$",
"source",
")",
";",
"$",
"indexSearchPath",
"=",
"sprintf",
"(",
"\"/%s/%s\"",
",",
"self",
"::",... | Convert dom node tree to array
@param mixed $source Configuration XML source.
@return array | [
"Convert",
"dom",
"node",
"tree",
"to",
"array"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Indices/Config/Converter.php#L49-L62 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Indices/Config/Converter.php | Converter.parseIndexConfig | private function parseIndexConfig(\DOMXPath $xpath, \DOMNode $indexRootNode)
{
$indexConfig = ['types' => []];
$typesSearchPath = sprintf('%s', self::TYPE_NODE_TYPE);
$xpath->query($typesSearchPath, $indexRootNode);
foreach ($xpath->query($typesSearchPath, $indexRootNode) as $typeNo... | php | private function parseIndexConfig(\DOMXPath $xpath, \DOMNode $indexRootNode)
{
$indexConfig = ['types' => []];
$typesSearchPath = sprintf('%s', self::TYPE_NODE_TYPE);
$xpath->query($typesSearchPath, $indexRootNode);
foreach ($xpath->query($typesSearchPath, $indexRootNode) as $typeNo... | [
"private",
"function",
"parseIndexConfig",
"(",
"\\",
"DOMXPath",
"$",
"xpath",
",",
"\\",
"DOMNode",
"$",
"indexRootNode",
")",
"{",
"$",
"indexConfig",
"=",
"[",
"'types'",
"=>",
"[",
"]",
"]",
";",
"$",
"typesSearchPath",
"=",
"sprintf",
"(",
"'%s'",
... | Parse index node configuration.
@param \DOMXPath $xpath XPath access to the document parsed.
@param \DOMNode $indexRootNode Index node to be parsed.
@return array | [
"Parse",
"index",
"node",
"configuration",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Indices/Config/Converter.php#L72-L86 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Indices/Config/Converter.php | Converter.parseTypeConfig | private function parseTypeConfig(\DOMXPath $xpath, \DOMNode $typeRootNode)
{
$staticFields = $this->parseMappingFields($xpath, $typeRootNode);
$idFieldName = $typeRootNode->getAttribute('idFieldName');
$datasources = $this->parseDatasources($xpath, $typeRootNode);
$mappingParam... | php | private function parseTypeConfig(\DOMXPath $xpath, \DOMNode $typeRootNode)
{
$staticFields = $this->parseMappingFields($xpath, $typeRootNode);
$idFieldName = $typeRootNode->getAttribute('idFieldName');
$datasources = $this->parseDatasources($xpath, $typeRootNode);
$mappingParam... | [
"private",
"function",
"parseTypeConfig",
"(",
"\\",
"DOMXPath",
"$",
"xpath",
",",
"\\",
"DOMNode",
"$",
"typeRootNode",
")",
"{",
"$",
"staticFields",
"=",
"$",
"this",
"->",
"parseMappingFields",
"(",
"$",
"xpath",
",",
"$",
"typeRootNode",
")",
";",
"$... | Parse type node configuration.
@param \DOMXPath $xpath XPath access to the document parsed.
@param \DOMNode $typeRootNode Type node to be parsed.
@return array | [
"Parse",
"type",
"node",
"configuration",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Indices/Config/Converter.php#L96-L105 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Indices/Config/Converter.php | Converter.parseMappingFields | private function parseMappingFields(\DOMXPath $xpath, \DOMNode $typeRootNode)
{
$fields = [];
$fieldSearchPath = sprintf('%s/%s', self::MAPPING_NODE_TYPE, self::MAPPING_FIELD_NODE_TYPE);
foreach ($xpath->query($fieldSearchPath, $typeRootNode) as $fieldNode) {
$fields[$fieldNode-... | php | private function parseMappingFields(\DOMXPath $xpath, \DOMNode $typeRootNode)
{
$fields = [];
$fieldSearchPath = sprintf('%s/%s', self::MAPPING_NODE_TYPE, self::MAPPING_FIELD_NODE_TYPE);
foreach ($xpath->query($fieldSearchPath, $typeRootNode) as $fieldNode) {
$fields[$fieldNode-... | [
"private",
"function",
"parseMappingFields",
"(",
"\\",
"DOMXPath",
"$",
"xpath",
",",
"\\",
"DOMNode",
"$",
"typeRootNode",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
";",
"$",
"fieldSearchPath",
"=",
"sprintf",
"(",
"'%s/%s'",
",",
"self",
"::",
"MAPPING_NO... | Parse type fields from type node configuration.
@param \DOMXPath $xpath XPath access to the document parsed.
@param \DOMNode $typeRootNode Type node to be parsed.
@return array | [
"Parse",
"type",
"fields",
"from",
"type",
"node",
"configuration",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Indices/Config/Converter.php#L115-L125 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Indices/Config/Converter.php | Converter.parseDatasources | private function parseDatasources(\DOMXPath $xpath, \DOMNode $typeRootNode)
{
$datasources = [];
foreach ($xpath->query(self::DATASOURCES_PATH, $typeRootNode) as $datasourceNode) {
$datasources[$datasourceNode->getAttribute('name')] = $datasourceNode->nodeValue;
}
retur... | php | private function parseDatasources(\DOMXPath $xpath, \DOMNode $typeRootNode)
{
$datasources = [];
foreach ($xpath->query(self::DATASOURCES_PATH, $typeRootNode) as $datasourceNode) {
$datasources[$datasourceNode->getAttribute('name')] = $datasourceNode->nodeValue;
}
retur... | [
"private",
"function",
"parseDatasources",
"(",
"\\",
"DOMXPath",
"$",
"xpath",
",",
"\\",
"DOMNode",
"$",
"typeRootNode",
")",
"{",
"$",
"datasources",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"xpath",
"->",
"query",
"(",
"self",
"::",
"DATASOURCES_PATH",... | Parse datasources from type node configuration.
@deprecated
@param \DOMXPath $xpath XPath access to the document parsed.
@param \DOMNode $typeRootNode Type node to be parsed.
@return array | [
"Parse",
"datasources",
"from",
"type",
"node",
"configuration",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Indices/Config/Converter.php#L137-L146 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Indices/Config/Converter.php | Converter.createMappingField | private function createMappingField(\DOMNode $fieldNode)
{
$fieldParam = ['type' => $fieldNode->getAttribute('type')];
if ($fieldNode->hasAttribute('nestedPath')) {
$fieldParam['nestedPath'] = $fieldNode->getAttribute('nestedPath');
}
foreach ($fieldNode->childNodes as ... | php | private function createMappingField(\DOMNode $fieldNode)
{
$fieldParam = ['type' => $fieldNode->getAttribute('type')];
if ($fieldNode->hasAttribute('nestedPath')) {
$fieldParam['nestedPath'] = $fieldNode->getAttribute('nestedPath');
}
foreach ($fieldNode->childNodes as ... | [
"private",
"function",
"createMappingField",
"(",
"\\",
"DOMNode",
"$",
"fieldNode",
")",
"{",
"$",
"fieldParam",
"=",
"[",
"'type'",
"=>",
"$",
"fieldNode",
"->",
"getAttribute",
"(",
"'type'",
")",
"]",
";",
"if",
"(",
"$",
"fieldNode",
"->",
"hasAttribu... | Parse field configuration params.
@param \DOMNode $fieldNode Field node to be parsed.
@return array | [
"Parse",
"field",
"configuration",
"params",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Indices/Config/Converter.php#L155-L171 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Indices/Config/Converter.php | Converter.underscore | private function underscore($name)
{
if (!isset($this->underscoreCache[$name])) {
$this->underscoreCache[$name] = strtolower(preg_replace('/(.)([A-Z])/', "$1_$2", $name));
}
return $this->underscoreCache[$name];
} | php | private function underscore($name)
{
if (!isset($this->underscoreCache[$name])) {
$this->underscoreCache[$name] = strtolower(preg_replace('/(.)([A-Z])/', "$1_$2", $name));
}
return $this->underscoreCache[$name];
} | [
"private",
"function",
"underscore",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"underscoreCache",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"underscoreCache",
"[",
"$",
"name",
"]",
"=",
"strtolower",... | Converts tag name from camelCase to snake_case
isSearchable === is_searchable
Uses cache to eliminate unnecessary preg_replace
@param string $name The name to transform
@return string | [
"Converts",
"tag",
"name",
"from",
"camelCase",
"to",
"snake_case"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Indices/Config/Converter.php#L183-L190 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Search/OptimizerFilter.php | OptimizerFilter.getOptimizerIds | public function getOptimizerIds()
{
$optimizerIds = null;
if ($this->searchContext->getCurrentSearchQuery()) {
$storeId = $this->searchContext->getStoreId();
$queryId = (int) $this->searchContext->getCurrentSearchQuery()->getId();
$cacheKey = sprintf("%s_%s", $... | php | public function getOptimizerIds()
{
$optimizerIds = null;
if ($this->searchContext->getCurrentSearchQuery()) {
$storeId = $this->searchContext->getStoreId();
$queryId = (int) $this->searchContext->getCurrentSearchQuery()->getId();
$cacheKey = sprintf("%s_%s", $... | [
"public",
"function",
"getOptimizerIds",
"(",
")",
"{",
"$",
"optimizerIds",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"searchContext",
"->",
"getCurrentSearchQuery",
"(",
")",
")",
"{",
"$",
"storeId",
"=",
"$",
"this",
"->",
"searchContext",
"->",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Search/OptimizerFilter.php#L67-L84 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Preview.php | Preview.prepareProductCollection | protected function prepareProductCollection(\Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection $collection)
{
$this->searchContext->setCurrentCategory($this->category);
$this->searchContext->setStoreId($this->category->getStoreId());
$collection->setVisibility([Visibi... | php | protected function prepareProductCollection(\Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection $collection)
{
$this->searchContext->setCurrentCategory($this->category);
$this->searchContext->setStoreId($this->category->getStoreId());
$collection->setVisibility([Visibi... | [
"protected",
"function",
"prepareProductCollection",
"(",
"\\",
"Smile",
"\\",
"ElasticsuiteCatalog",
"\\",
"Model",
"\\",
"ResourceModel",
"\\",
"Product",
"\\",
"Fulltext",
"\\",
"Collection",
"$",
"collection",
")",
"{",
"$",
"this",
"->",
"searchContext",
"->"... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Preview.php#L78-L90 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Preview.php | Preview.getQueryFilter | private function getQueryFilter()
{
$query = null;
$this->category->setIsActive(true);
if ($this->category->getIsVirtualCategory() || $this->category->getId()) {
$query = $this->category->getVirtualRule()->getCategorySearchQuery($this->category);
}
if ((bool) $... | php | private function getQueryFilter()
{
$query = null;
$this->category->setIsActive(true);
if ($this->category->getIsVirtualCategory() || $this->category->getId()) {
$query = $this->category->getVirtualRule()->getCategorySearchQuery($this->category);
}
if ((bool) $... | [
"private",
"function",
"getQueryFilter",
"(",
")",
"{",
"$",
"query",
"=",
"null",
";",
"$",
"this",
"->",
"category",
"->",
"setIsActive",
"(",
"true",
")",
";",
"if",
"(",
"$",
"this",
"->",
"category",
"->",
"getIsVirtualCategory",
"(",
")",
"||",
"... | Return the filter applied to the query.
@return QueryInterface | [
"Return",
"the",
"filter",
"applied",
"to",
"the",
"query",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Preview.php#L107-L139 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Indexer/AbstractIndexerPlugin.php | AbstractIndexerPlugin.processFullTextIndex | protected function processFullTextIndex($ids)
{
$fullTextIndexer = $this->indexerRegistry->get(\Magento\CatalogSearch\Model\Indexer\Fulltext::INDEXER_ID);
if (!is_array($ids)) {
$ids = [$ids];
}
$parentIds = $this->fullIndexer->getRelationsByChild($ids);
$proce... | php | protected function processFullTextIndex($ids)
{
$fullTextIndexer = $this->indexerRegistry->get(\Magento\CatalogSearch\Model\Indexer\Fulltext::INDEXER_ID);
if (!is_array($ids)) {
$ids = [$ids];
}
$parentIds = $this->fullIndexer->getRelationsByChild($ids);
$proce... | [
"protected",
"function",
"processFullTextIndex",
"(",
"$",
"ids",
")",
"{",
"$",
"fullTextIndexer",
"=",
"$",
"this",
"->",
"indexerRegistry",
"->",
"get",
"(",
"\\",
"Magento",
"\\",
"CatalogSearch",
"\\",
"Model",
"\\",
"Indexer",
"\\",
"Fulltext",
"::",
"... | Process full-text reindex for product ids
@param mixed $ids The product ids to reindex | [
"Process",
"full",
"-",
"text",
"reindex",
"for",
"product",
"ids"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Indexer/AbstractIndexerPlugin.php#L49-L65 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Helper/IndexSettings.php | IndexSettings.getLocaleCode | public function getLocaleCode($store)
{
$configPath = self::LOCALE_CODE_CONFIG_XML_PATH;
$scopeType = ScopeInterface::SCOPE_STORES;
$store = $this->getStore($store);
return $this->scopeConfig->getValue($configPath, $scopeType, $store);
} | php | public function getLocaleCode($store)
{
$configPath = self::LOCALE_CODE_CONFIG_XML_PATH;
$scopeType = ScopeInterface::SCOPE_STORES;
$store = $this->getStore($store);
return $this->scopeConfig->getValue($configPath, $scopeType, $store);
} | [
"public",
"function",
"getLocaleCode",
"(",
"$",
"store",
")",
"{",
"$",
"configPath",
"=",
"self",
"::",
"LOCALE_CODE_CONFIG_XML_PATH",
";",
"$",
"scopeType",
"=",
"ScopeInterface",
"::",
"SCOPE_STORES",
";",
"$",
"store",
"=",
"$",
"this",
"->",
"getStore",
... | Return the locale code (eg.: "en_US") for a store.
@param integer|string|\Magento\Store\Api\Data\StoreInterface $store The store.
@return string | [
"Return",
"the",
"locale",
"code",
"(",
"eg",
".",
":",
"en_US",
")",
"for",
"a",
"store",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Helper/IndexSettings.php#L50-L57 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Helper/IndexSettings.php | IndexSettings.getLanguageCode | public function getLanguageCode($store)
{
$store = $this->getStore($store);
$languageCode = current(explode('_', $this->getLocaleCode($store)));
return $languageCode;
} | php | public function getLanguageCode($store)
{
$store = $this->getStore($store);
$languageCode = current(explode('_', $this->getLocaleCode($store)));
return $languageCode;
} | [
"public",
"function",
"getLanguageCode",
"(",
"$",
"store",
")",
"{",
"$",
"store",
"=",
"$",
"this",
"->",
"getStore",
"(",
"$",
"store",
")",
";",
"$",
"languageCode",
"=",
"current",
"(",
"explode",
"(",
"'_'",
",",
"$",
"this",
"->",
"getLocaleCode... | Return the locale code (eg.: "en") for a store.
@param integer|string|\Magento\Store\Api\Data\StoreInterface $store The store.
@return string | [
"Return",
"the",
"locale",
"code",
"(",
"eg",
".",
":",
"en",
")",
"for",
"a",
"store",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Helper/IndexSettings.php#L66-L72 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Helper/IndexSettings.php | IndexSettings.createIndexNameFromIdentifier | public function createIndexNameFromIdentifier($indexIdentifier, $store)
{
/*
* Generate the suffix of the index name from the current date.
* e.g : Default pattern "{{YYYYMMdd}}_{{HHmmss}}" is converted to "20160221-123421".
*/
$indiceNameSuffix = $this->getIndicesSetting... | php | public function createIndexNameFromIdentifier($indexIdentifier, $store)
{
/*
* Generate the suffix of the index name from the current date.
* e.g : Default pattern "{{YYYYMMdd}}_{{HHmmss}}" is converted to "20160221-123421".
*/
$indiceNameSuffix = $this->getIndicesSetting... | [
"public",
"function",
"createIndexNameFromIdentifier",
"(",
"$",
"indexIdentifier",
",",
"$",
"store",
")",
"{",
"/*\n * Generate the suffix of the index name from the current date.\n * e.g : Default pattern \"{{YYYYMMdd}}_{{HHmmss}}\" is converted to \"20160221-123421\".\n ... | Create a new index for an identifier (eg. catalog_product) by store including current date.
@param string $indexIdentifier Index identifier.
@param integer|string|\Magento\Store\Api\Data\StoreInterface $store The store.
@return string | [
"Create",
"a",
"new",
"index",
"for",
"an",
"identifier",
"(",
"eg",
".",
"catalog_product",
")",
"by",
"store",
"including",
"current",
"date",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Helper/IndexSettings.php#L82-L103 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Helper/IndexSettings.php | IndexSettings.getIndexAliasFromIdentifier | public function getIndexAliasFromIdentifier($indexIdentifier, $store)
{
$store = strtolower($this->getStoreCode($store));
return sprintf('%s_%s_%s', $this->getIndexAlias(), $store, $indexIdentifier);
} | php | public function getIndexAliasFromIdentifier($indexIdentifier, $store)
{
$store = strtolower($this->getStoreCode($store));
return sprintf('%s_%s_%s', $this->getIndexAlias(), $store, $indexIdentifier);
} | [
"public",
"function",
"getIndexAliasFromIdentifier",
"(",
"$",
"indexIdentifier",
",",
"$",
"store",
")",
"{",
"$",
"store",
"=",
"strtolower",
"(",
"$",
"this",
"->",
"getStoreCode",
"(",
"$",
"store",
")",
")",
";",
"return",
"sprintf",
"(",
"'%s_%s_%s'",
... | Returns the index alias for an identifier (eg. catalog_product) by store.
@param string $indexIdentifier An index identifier.
@param integer|string|\Magento\Store\Api\Data\StoreInterface $store The store.
@return string | [
"Returns",
"the",
"index",
"alias",
"for",
"an",
"identifier",
"(",
"eg",
".",
"catalog_product",
")",
"by",
"store",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Helper/IndexSettings.php#L113-L118 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Helper/IndexSettings.php | IndexSettings.getStore | private function getStore($store)
{
if (!is_object($store)) {
$store = $this->storeManager->getStore($store);
}
return $store;
} | php | private function getStore($store)
{
if (!is_object($store)) {
$store = $this->storeManager->getStore($store);
}
return $store;
} | [
"private",
"function",
"getStore",
"(",
"$",
"store",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"store",
")",
")",
"{",
"$",
"store",
"=",
"$",
"this",
"->",
"storeManager",
"->",
"getStore",
"(",
"$",
"store",
")",
";",
"}",
"return",
"$",
... | Ensure store is an object or load it from it's id / identifier.
@param integer|string|\Magento\Store\Api\Data\StoreInterface $store The store identifier or id.
@return \Magento\Store\Api\Data\StoreInterface | [
"Ensure",
"store",
"is",
"an",
"object",
"or",
"load",
"it",
"from",
"it",
"s",
"id",
"/",
"identifier",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Helper/IndexSettings.php#L203-L210 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Search/Request/Product/Attribute/Aggregation/Category.php | Category.getAggregationData | public function getAggregationData(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute)
{
$facetQueries = $this->getFacetQueries();
$bucketConfig = ['type' => BucketInterface::TYPE_QUERY_GROUP, 'name' => 'categories', 'queries' => $facetQueries];
return $bucketConfig;
} | php | public function getAggregationData(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute)
{
$facetQueries = $this->getFacetQueries();
$bucketConfig = ['type' => BucketInterface::TYPE_QUERY_GROUP, 'name' => 'categories', 'queries' => $facetQueries];
return $bucketConfig;
} | [
"public",
"function",
"getAggregationData",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"ResourceModel",
"\\",
"Eav",
"\\",
"Attribute",
"$",
"attribute",
")",
"{",
"$",
"facetQueries",
"=",
"$",
"this",
"->",
"getFacetQueries",
"(",
")",
";"... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Search/Request/Product/Attribute/Aggregation/Category.php#L71-L77 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Search/Request/Product/Attribute/Aggregation/Category.php | Category.getCurrentCategory | private function getCurrentCategory()
{
$category = $this->context->getCurrentCategory();
if (null === $category) {
$category = $this->categoryRepository->get(
$this->storeManager->getStore()->getRootCategoryId(),
$this->storeManager->getStore()->getId()
... | php | private function getCurrentCategory()
{
$category = $this->context->getCurrentCategory();
if (null === $category) {
$category = $this->categoryRepository->get(
$this->storeManager->getStore()->getRootCategoryId(),
$this->storeManager->getStore()->getId()
... | [
"private",
"function",
"getCurrentCategory",
"(",
")",
"{",
"$",
"category",
"=",
"$",
"this",
"->",
"context",
"->",
"getCurrentCategory",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"category",
")",
"{",
"$",
"category",
"=",
"$",
"this",
"->",
"ca... | Retrieve current category from search context or instantiate the default root of current store.
@return \Magento\Catalog\Api\Data\CategoryInterface | [
"Retrieve",
"current",
"category",
"from",
"search",
"context",
"or",
"instantiate",
"the",
"default",
"root",
"of",
"current",
"store",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Search/Request/Product/Attribute/Aggregation/Category.php#L94-L106 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Plugin/Search/RequestMapperPlugin.php | RequestMapperPlugin.afterGetFilters | public function afterGetFilters(
RequestMapper $subject,
$result,
ContainerConfigurationInterface $containerConfiguration,
SearchCriteriaInterface $searchCriteria
) {
if ($this->isEnabled($containerConfiguration) && isset($result['category.category_id'])) {
$categ... | php | public function afterGetFilters(
RequestMapper $subject,
$result,
ContainerConfigurationInterface $containerConfiguration,
SearchCriteriaInterface $searchCriteria
) {
if ($this->isEnabled($containerConfiguration) && isset($result['category.category_id'])) {
$categ... | [
"public",
"function",
"afterGetFilters",
"(",
"RequestMapper",
"$",
"subject",
",",
"$",
"result",
",",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
",",
"SearchCriteriaInterface",
"$",
"searchCriteria",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"... | Post process catalog filters (virtual categories handling).
@SuppressWarnings(PHPMD.UnusedFormalParameter)
@param RequestMapper $subject Request mapper.
@param array $result Original filters.
@param ContainerConfigurationInterface $containerCo... | [
"Post",
"process",
"catalog",
"filters",
"(",
"virtual",
"categories",
"handling",
")",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Plugin/Search/RequestMapperPlugin.php#L65-L81 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/Report/SearchRequestBuilder.php | SearchRequestBuilder.getRequest | public function getRequest()
{
$storeId = $this->context->getStoreId();
$aggregations = $this->getAggregations();
$searchQuery = $this->getSearchQuery();
return $this->searchRequestBuilder->create($storeId, $this->containerName, 0, 0, null, [], [], $searchQuery, $aggregations)... | php | public function getRequest()
{
$storeId = $this->context->getStoreId();
$aggregations = $this->getAggregations();
$searchQuery = $this->getSearchQuery();
return $this->searchRequestBuilder->create($storeId, $this->containerName, 0, 0, null, [], [], $searchQuery, $aggregations)... | [
"public",
"function",
"getRequest",
"(",
")",
"{",
"$",
"storeId",
"=",
"$",
"this",
"->",
"context",
"->",
"getStoreId",
"(",
")",
";",
"$",
"aggregations",
"=",
"$",
"this",
"->",
"getAggregations",
"(",
")",
";",
"$",
"searchQuery",
"=",
"$",
"this"... | Get request.
@return \Smile\ElasticsuiteCore\Search\RequestInterface | [
"Get",
"request",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Report/SearchRequestBuilder.php#L78-L85 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/Report/SearchRequestBuilder.php | SearchRequestBuilder.getSearchQuery | private function getSearchQuery()
{
$queries = [];
foreach ($this->queryProviders as $queryProvider) {
$queries[] = $queryProvider->getQuery();
}
return array_filter($queries);
} | php | private function getSearchQuery()
{
$queries = [];
foreach ($this->queryProviders as $queryProvider) {
$queries[] = $queryProvider->getQuery();
}
return array_filter($queries);
} | [
"private",
"function",
"getSearchQuery",
"(",
")",
"{",
"$",
"queries",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"queryProviders",
"as",
"$",
"queryProvider",
")",
"{",
"$",
"queries",
"[",
"]",
"=",
"$",
"queryProvider",
"->",
"getQuery",
... | Get query filters.
@return array | [
"Get",
"query",
"filters",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Report/SearchRequestBuilder.php#L92-L101 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/Report/SearchRequestBuilder.php | SearchRequestBuilder.getAggregations | private function getAggregations()
{
$aggs = [];
foreach ($this->aggregationProviders as $aggregationProvider) {
$aggs[] = $aggregationProvider->getAggregation();
}
return $aggs;
} | php | private function getAggregations()
{
$aggs = [];
foreach ($this->aggregationProviders as $aggregationProvider) {
$aggs[] = $aggregationProvider->getAggregation();
}
return $aggs;
} | [
"private",
"function",
"getAggregations",
"(",
")",
"{",
"$",
"aggs",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"aggregationProviders",
"as",
"$",
"aggregationProvider",
")",
"{",
"$",
"aggs",
"[",
"]",
"=",
"$",
"aggregationProvider",
"->",
... | Get aggregations.
@return array | [
"Get",
"aggregations",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Report/SearchRequestBuilder.php#L108-L117 |
Smile-SA/elasticsuite | src/module-elasticsuite-swatches/Block/Navigation/Renderer/Swatches/RenderLayered.php | RenderLayered.getFilterOption | protected function getFilterOption(array $filterItems, Option $swatchOption)
{
$resultOption = false;
$filterItem = $this->getFilterItemByLabel($filterItems, $swatchOption->getLabel());
if ($filterItem && $this->isOptionVisible($filterItem)) {
$resultOption = $this->getOptionView... | php | protected function getFilterOption(array $filterItems, Option $swatchOption)
{
$resultOption = false;
$filterItem = $this->getFilterItemByLabel($filterItems, $swatchOption->getLabel());
if ($filterItem && $this->isOptionVisible($filterItem)) {
$resultOption = $this->getOptionView... | [
"protected",
"function",
"getFilterOption",
"(",
"array",
"$",
"filterItems",
",",
"Option",
"$",
"swatchOption",
")",
"{",
"$",
"resultOption",
"=",
"false",
";",
"$",
"filterItem",
"=",
"$",
"this",
"->",
"getFilterItemByLabel",
"(",
"$",
"filterItems",
",",... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-swatches/Block/Navigation/Renderer/Swatches/RenderLayered.php#L32-L41 |
Smile-SA/elasticsuite | src/module-elasticsuite-swatches/Block/Navigation/Renderer/Swatches/RenderLayered.php | RenderLayered.getOptionViewData | protected function getOptionViewData(FilterItem $filterItem, Option $swatchOption)
{
$customStyle = '';
$linkToOption = $filterItem->getUrl();
if ($this->isOptionDisabled($filterItem)) {
$customStyle = 'disabled';
$linkToOption = 'javascript:void();';
}
... | php | protected function getOptionViewData(FilterItem $filterItem, Option $swatchOption)
{
$customStyle = '';
$linkToOption = $filterItem->getUrl();
if ($this->isOptionDisabled($filterItem)) {
$customStyle = 'disabled';
$linkToOption = 'javascript:void();';
}
... | [
"protected",
"function",
"getOptionViewData",
"(",
"FilterItem",
"$",
"filterItem",
",",
"Option",
"$",
"swatchOption",
")",
"{",
"$",
"customStyle",
"=",
"''",
";",
"$",
"linkToOption",
"=",
"$",
"filterItem",
"->",
"getUrl",
"(",
")",
";",
"if",
"(",
"$"... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-swatches/Block/Navigation/Renderer/Swatches/RenderLayered.php#L46-L66 |
Smile-SA/elasticsuite | src/module-elasticsuite-swatches/Block/Navigation/Renderer/Swatches/RenderLayered.php | RenderLayered.getFilterItemByLabel | protected function getFilterItemByLabel(array $filterItems, $filterLabel)
{
foreach ($filterItems as $item) {
if ((string) $item->getValue() === (string) $filterLabel) {
return $item;
}
}
return false;
} | php | protected function getFilterItemByLabel(array $filterItems, $filterLabel)
{
foreach ($filterItems as $item) {
if ((string) $item->getValue() === (string) $filterLabel) {
return $item;
}
}
return false;
} | [
"protected",
"function",
"getFilterItemByLabel",
"(",
"array",
"$",
"filterItems",
",",
"$",
"filterLabel",
")",
"{",
"foreach",
"(",
"$",
"filterItems",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"(",
"string",
")",
"$",
"item",
"->",
"getValue",
"(",
")",... | Fetch Filter item by it's label.
@param FilterItem[] $filterItems All Filter items
@param string $filterLabel Filter Label
@return bool|FilterItem | [
"Fetch",
"Filter",
"item",
"by",
"it",
"s",
"label",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-swatches/Block/Navigation/Renderer/Swatches/RenderLayered.php#L77-L86 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/ResourceModel/VirtualCategory/Collection.php | Collection.getVirtualRuleReadHandler | private function getVirtualRuleReadHandler()
{
if ($this->virtualRuleReadHandler === null) {
$this->virtualRuleReadHandler = $this->_universalFactory->create(VirtualRuleReadHandler::class);
}
return $this->virtualRuleReadHandler;
} | php | private function getVirtualRuleReadHandler()
{
if ($this->virtualRuleReadHandler === null) {
$this->virtualRuleReadHandler = $this->_universalFactory->create(VirtualRuleReadHandler::class);
}
return $this->virtualRuleReadHandler;
} | [
"private",
"function",
"getVirtualRuleReadHandler",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"virtualRuleReadHandler",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"virtualRuleReadHandler",
"=",
"$",
"this",
"->",
"_universalFactory",
"->",
"create",
"(",
"... | Virtual rule read handler.
@return \Smile\ElasticsuiteVirtualCategory\Model\Category\Attribute\VirtualRule\ReadHandler | [
"Virtual",
"rule",
"read",
"handler",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/ResourceModel/VirtualCategory/Collection.php#L52-L59 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Block/Product/Conditions.php | Conditions.getNewChildUrl | public function getNewChildUrl()
{
$urlParams = [
'form' => $this->getElement()->getContainer()->getHtmlId(),
'element_name' => $this->getElement()->getName(),
];
if (is_array($this->getData('url_params'))) {
$urlParams = array_merge($urlParams, $... | php | public function getNewChildUrl()
{
$urlParams = [
'form' => $this->getElement()->getContainer()->getHtmlId(),
'element_name' => $this->getElement()->getName(),
];
if (is_array($this->getData('url_params'))) {
$urlParams = array_merge($urlParams, $... | [
"public",
"function",
"getNewChildUrl",
"(",
")",
"{",
"$",
"urlParams",
"=",
"[",
"'form'",
"=>",
"$",
"this",
"->",
"getElement",
"(",
")",
"->",
"getContainer",
"(",
")",
"->",
"getHtmlId",
"(",
")",
",",
"'element_name'",
"=>",
"$",
"this",
"->",
"... | Get URL used to create a new child condition into the rule.
@return string | [
"Get",
"URL",
"used",
"to",
"create",
"a",
"new",
"child",
"condition",
"into",
"the",
"rule",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Block/Product/Conditions.php#L100-L112 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Block/Product/Conditions.php | Conditions.getInputHtml | public function getInputHtml()
{
$this->rule->setElementName($this->element->getName());
if ($this->element->getValue()) {
/* Hack : reload in a new instance to have element name set.
* can not be done in afterLoad of the backend model
* since we ... | php | public function getInputHtml()
{
$this->rule->setElementName($this->element->getName());
if ($this->element->getValue()) {
/* Hack : reload in a new instance to have element name set.
* can not be done in afterLoad of the backend model
* since we ... | [
"public",
"function",
"getInputHtml",
"(",
")",
"{",
"$",
"this",
"->",
"rule",
"->",
"setElementName",
"(",
"$",
"this",
"->",
"element",
"->",
"getName",
"(",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"element",
"->",
"getValue",
"(",
")",
")",
... | Render HTML of the element using the rule engine.
@return string | [
"Render",
"HTML",
"of",
"the",
"element",
"using",
"the",
"rule",
"engine",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Block/Product/Conditions.php#L139-L166 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Block/Product/Conditions.php | Conditions.setConditionFormName | private function setConditionFormName(\Magento\Rule\Model\Condition\AbstractCondition $conditions, $formName)
{
$conditions->setJsFormObject($formName);
if ($conditions->getConditions() && is_array($conditions->getConditions())) {
foreach ($conditions->getConditions() as $condition) {
... | php | private function setConditionFormName(\Magento\Rule\Model\Condition\AbstractCondition $conditions, $formName)
{
$conditions->setJsFormObject($formName);
if ($conditions->getConditions() && is_array($conditions->getConditions())) {
foreach ($conditions->getConditions() as $condition) {
... | [
"private",
"function",
"setConditionFormName",
"(",
"\\",
"Magento",
"\\",
"Rule",
"\\",
"Model",
"\\",
"Condition",
"\\",
"AbstractCondition",
"$",
"conditions",
",",
"$",
"formName",
")",
"{",
"$",
"conditions",
"->",
"setJsFormObject",
"(",
"$",
"formName",
... | Set proper form name to rule conditions.
@param \Magento\Rule\Model\Condition\AbstractCondition $conditions Rule conditions.
@param string $formName Form Name.
@return void | [
"Set",
"proper",
"form",
"name",
"to",
"rule",
"conditions",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Block/Product/Conditions.php#L176-L185 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Block/Product/Conditions.php | Conditions.setConditionUrlParams | private function setConditionUrlParams(\Magento\Rule\Model\Condition\AbstractCondition $conditions, $urlParams)
{
$conditions->setUrlParams($urlParams);
if ($conditions->getConditions() && is_array($conditions->getConditions())) {
foreach ($conditions->getConditions() as $condition) {
... | php | private function setConditionUrlParams(\Magento\Rule\Model\Condition\AbstractCondition $conditions, $urlParams)
{
$conditions->setUrlParams($urlParams);
if ($conditions->getConditions() && is_array($conditions->getConditions())) {
foreach ($conditions->getConditions() as $condition) {
... | [
"private",
"function",
"setConditionUrlParams",
"(",
"\\",
"Magento",
"\\",
"Rule",
"\\",
"Model",
"\\",
"Condition",
"\\",
"AbstractCondition",
"$",
"conditions",
",",
"$",
"urlParams",
")",
"{",
"$",
"conditions",
"->",
"setUrlParams",
"(",
"$",
"urlParams",
... | Set proper url params to rule conditions.
@param \Magento\Rule\Model\Condition\AbstractCondition $conditions Rule conditions.
@param array $urlParams URL Params.
@return void | [
"Set",
"proper",
"url",
"params",
"to",
"rule",
"conditions",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Block/Product/Conditions.php#L195-L204 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php | RequestMapperPlugin.afterGetSortOrders | public function afterGetSortOrders(
RequestMapper $subject,
$result,
ContainerConfigurationInterface $containerConfiguration,
SearchCriteriaInterface $searchCriteria
) {
if ($this->isEnabled($containerConfiguration)) {
$sortOrders = [];
if ($container... | php | public function afterGetSortOrders(
RequestMapper $subject,
$result,
ContainerConfigurationInterface $containerConfiguration,
SearchCriteriaInterface $searchCriteria
) {
if ($this->isEnabled($containerConfiguration)) {
$sortOrders = [];
if ($container... | [
"public",
"function",
"afterGetSortOrders",
"(",
"RequestMapper",
"$",
"subject",
",",
"$",
"result",
",",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
",",
"SearchCriteriaInterface",
"$",
"searchCriteria",
")",
"{",
"if",
"(",
"$",
"this",
"->",
... | Post process catalog sort orders.
@SuppressWarnings(PHPMD.UnusedFormalParameter)
@param RequestMapper $subject Request mapper.
@param array $result Original sort orders.
@param ContainerConfigurationInterface $containerConfiguration Container ... | [
"Post",
"process",
"catalog",
"sort",
"orders",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php#L109-L137 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php | RequestMapperPlugin.afterGetFilters | public function afterGetFilters(
RequestMapper $subject,
$result,
ContainerConfigurationInterface $containerConfiguration,
SearchCriteriaInterface $searchCriteria
) {
if ($this->isEnabled($containerConfiguration)) {
$filters = [];
foreach ($result as ... | php | public function afterGetFilters(
RequestMapper $subject,
$result,
ContainerConfigurationInterface $containerConfiguration,
SearchCriteriaInterface $searchCriteria
) {
if ($this->isEnabled($containerConfiguration)) {
$filters = [];
foreach ($result as ... | [
"public",
"function",
"afterGetFilters",
"(",
"RequestMapper",
"$",
"subject",
",",
"$",
"result",
",",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
",",
"SearchCriteriaInterface",
"$",
"searchCriteria",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"... | Post process catalog filters.
@SuppressWarnings(PHPMD.UnusedFormalParameter)
@param RequestMapper $subject Request mapper.
@param array $result Original filters.
@param ContainerConfigurationInterface $containerConfiguration Container configur... | [
"Post",
"process",
"catalog",
"filters",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php#L151-L176 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php | RequestMapperPlugin.getMappingField | private function getMappingField(ContainerConfigurationInterface $containerConfiguration, $fieldName)
{
if (isset($this->fieldMapper[$fieldName])) {
$fieldName = $this->fieldMapper[$fieldName];
}
try {
$optionTextFieldName = $this->mappingHelper->getOptionTextFieldNa... | php | private function getMappingField(ContainerConfigurationInterface $containerConfiguration, $fieldName)
{
if (isset($this->fieldMapper[$fieldName])) {
$fieldName = $this->fieldMapper[$fieldName];
}
try {
$optionTextFieldName = $this->mappingHelper->getOptionTextFieldNa... | [
"private",
"function",
"getMappingField",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
",",
"$",
"fieldName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"fieldMapper",
"[",
"$",
"fieldName",
"]",
")",
")",
"{",
"$",
"fieldN... | Name of the field in the search engine mapping.
@param ContainerConfigurationInterface $containerConfiguration Container configuration.
@param string $fieldName Request field name.
@return string | [
"Name",
"of",
"the",
"field",
"in",
"the",
"search",
"engine",
"mapping",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php#L186-L201 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php | RequestMapperPlugin.getCurrentCategoryId | private function getCurrentCategoryId(ContainerConfigurationInterface $containerConfiguration, SearchCriteriaInterface $searchCriteria)
{
$store = $this->storeManager->getStore($containerConfiguration->getStoreId());
$categoryId = $this->storeManager->getGroup($store->getStoreGroupId())->getRoo... | php | private function getCurrentCategoryId(ContainerConfigurationInterface $containerConfiguration, SearchCriteriaInterface $searchCriteria)
{
$store = $this->storeManager->getStore($containerConfiguration->getStoreId());
$categoryId = $this->storeManager->getGroup($store->getStoreGroupId())->getRoo... | [
"private",
"function",
"getCurrentCategoryId",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
",",
"SearchCriteriaInterface",
"$",
"searchCriteria",
")",
"{",
"$",
"store",
"=",
"$",
"this",
"->",
"storeManager",
"->",
"getStore",
"(",
"$",
"co... | Return current category id for the search request.
@param ContainerConfigurationInterface $containerConfiguration Container configuration.
@param SearchCriteriaInterface $searchCriteria Search criteria.
@return integer | [
"Return",
"current",
"category",
"id",
"for",
"the",
"search",
"request",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php#L211-L225 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php | RequestMapperPlugin.updateSearchContext | private function updateSearchContext($storeId, $categoryId)
{
$this->searchContext->setStoreId($storeId);
$category = $this->categoryRepository->get($categoryId, $storeId);
if ($category->getId()) {
$this->searchContext->setCurrentCategory($category);
}
} | php | private function updateSearchContext($storeId, $categoryId)
{
$this->searchContext->setStoreId($storeId);
$category = $this->categoryRepository->get($categoryId, $storeId);
if ($category->getId()) {
$this->searchContext->setCurrentCategory($category);
}
} | [
"private",
"function",
"updateSearchContext",
"(",
"$",
"storeId",
",",
"$",
"categoryId",
")",
"{",
"$",
"this",
"->",
"searchContext",
"->",
"setStoreId",
"(",
"$",
"storeId",
")",
";",
"$",
"category",
"=",
"$",
"this",
"->",
"categoryRepository",
"->",
... | Update the search context using current store id and category Id.
@param integer $storeId Store id.
@param integer $categoryId Category Id.
@return void | [
"Update",
"the",
"search",
"context",
"using",
"current",
"store",
"id",
"and",
"category",
"Id",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php#L235-L243 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/Terms.php | Terms.buildQuery | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_TERMS) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$searchQuery = ['terms' => [$query->getField() => $query->getValues(), 'bo... | php | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_TERMS) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$searchQuery = ['terms' => [$query->getField() => $query->getValues(), 'bo... | [
"public",
"function",
"buildQuery",
"(",
"QueryInterface",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"->",
"getType",
"(",
")",
"!==",
"QueryInterface",
"::",
"TYPE_TERMS",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Query builde... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/Terms.php#L32-L45 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/RequestBuilder.php | RequestBuilder.getSearchRequestParams | public function getSearchRequestParams(
ContainerConfigurationInterface $containerConfig,
$category = null,
$queryText = null,
$size = 20
) {
$sortOrders = [];
$query = $this->queryFactory->create(\Magento\Framework\Search\Request\QueryInterface::TYPE_BOOL, []);
... | php | public function getSearchRequestParams(
ContainerConfigurationInterface $containerConfig,
$category = null,
$queryText = null,
$size = 20
) {
$sortOrders = [];
$query = $this->queryFactory->create(\Magento\Framework\Search\Request\QueryInterface::TYPE_BOOL, []);
... | [
"public",
"function",
"getSearchRequestParams",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"$",
"category",
"=",
"null",
",",
"$",
"queryText",
"=",
"null",
",",
"$",
"size",
"=",
"20",
")",
"{",
"$",
"sortOrders",
"=",
"[",
"]",
";... | Prepare the Search Request Params
@param ContainerConfigurationInterface $containerConfig Container Configuration
@param CategoryInterface $category The category
@param string $queryText The query text
@param int $size Query Siz... | [
"Prepare",
"the",
"Search",
"Request",
"Params"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/RequestBuilder.php#L113-L143 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/FunctionScore.php | FunctionScore.buildQuery | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_FUNCTIONSCORE) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$searchQueryParams = [
'score_mode' => $query->getScor... | php | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_FUNCTIONSCORE) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$searchQueryParams = [
'score_mode' => $query->getScor... | [
"public",
"function",
"buildQuery",
"(",
"QueryInterface",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"->",
"getType",
"(",
")",
"!==",
"QueryInterface",
"::",
"TYPE_FUNCTIONSCORE",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Quer... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/FunctionScore.php#L32-L59 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Category/OptimizerFilter.php | OptimizerFilter.getOptimizerIds | public function getOptimizerIds()
{
$optimizerIds = null;
if ($this->searchContext->getCurrentCategory()) {
$storeId = $this->searchContext->getStoreId();
$categoryId = (int) $this->searchContext->getCurrentCategory()->getId();
$cacheKey = sprintf("%s_%s", $... | php | public function getOptimizerIds()
{
$optimizerIds = null;
if ($this->searchContext->getCurrentCategory()) {
$storeId = $this->searchContext->getStoreId();
$categoryId = (int) $this->searchContext->getCurrentCategory()->getId();
$cacheKey = sprintf("%s_%s", $... | [
"public",
"function",
"getOptimizerIds",
"(",
")",
"{",
"$",
"optimizerIds",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"searchContext",
"->",
"getCurrentCategory",
"(",
")",
")",
"{",
"$",
"storeId",
"=",
"$",
"this",
"->",
"searchContext",
"->",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Category/OptimizerFilter.php#L59-L76 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/Search/Usage/Kpi/ConversionRates/AggregationProvider.php | AggregationProvider.getQueries | private function getQueries()
{
$queries = [
'all' => $this->queryFactory->create(
QueryInterface::TYPE_BOOL,
[]
),
'searches' => $this->queryFactory->create(
QueryInterface::TYPE_EXISTS,
[
... | php | private function getQueries()
{
$queries = [
'all' => $this->queryFactory->create(
QueryInterface::TYPE_BOOL,
[]
),
'searches' => $this->queryFactory->create(
QueryInterface::TYPE_EXISTS,
[
... | [
"private",
"function",
"getQueries",
"(",
")",
"{",
"$",
"queries",
"=",
"[",
"'all'",
"=>",
"$",
"this",
"->",
"queryFactory",
"->",
"create",
"(",
"QueryInterface",
"::",
"TYPE_BOOL",
",",
"[",
"]",
")",
",",
"'searches'",
"=>",
"$",
"this",
"->",
"q... | Return the queries of the query group aggregation.
@return array | [
"Return",
"the",
"queries",
"of",
"the",
"query",
"group",
"aggregation",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Search/Usage/Kpi/ConversionRates/AggregationProvider.php#L80-L102 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/Search/Usage/Kpi/ConversionRates/AggregationProvider.php | AggregationProvider.getConversionRateAggregation | private function getConversionRateAggregation()
{
return $this->aggregationFactory->create(
BucketInterface::TYPE_QUERY_GROUP,
[
'queries' => [
'sales' => $this->queryFactory->create(QueryInterface::TYPE_EXISTS, ['field' => 'product_sale']),
... | php | private function getConversionRateAggregation()
{
return $this->aggregationFactory->create(
BucketInterface::TYPE_QUERY_GROUP,
[
'queries' => [
'sales' => $this->queryFactory->create(QueryInterface::TYPE_EXISTS, ['field' => 'product_sale']),
... | [
"private",
"function",
"getConversionRateAggregation",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"aggregationFactory",
"->",
"create",
"(",
"BucketInterface",
"::",
"TYPE_QUERY_GROUP",
",",
"[",
"'queries'",
"=>",
"[",
"'sales'",
"=>",
"$",
"this",
"->",
"quer... | Return the child aggregation used to compute the conversion rate of sessions.
@return BucketInterface | [
"Return",
"the",
"child",
"aggregation",
"used",
"to",
"compute",
"the",
"conversion",
"rate",
"of",
"sessions",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Search/Usage/Kpi/ConversionRates/AggregationProvider.php#L109-L120 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/IndexSettings.php | IndexSettings.getAnalysisSettings | public function getAnalysisSettings($store)
{
$language = $this->helper->getLanguageCode($store);
return $this->analysisConfig->get($language);
} | php | public function getAnalysisSettings($store)
{
$language = $this->helper->getLanguageCode($store);
return $this->analysisConfig->get($language);
} | [
"public",
"function",
"getAnalysisSettings",
"(",
"$",
"store",
")",
"{",
"$",
"language",
"=",
"$",
"this",
"->",
"helper",
"->",
"getLanguageCode",
"(",
"$",
"store",
")",
";",
"return",
"$",
"this",
"->",
"analysisConfig",
"->",
"get",
"(",
"$",
"lang... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/IndexSettings.php#L120-L125 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/IndexSettings.php | IndexSettings.getCreateIndexSettings | public function getCreateIndexSettings()
{
$settings = [
'requests.cache.enable' => true,
'number_of_replicas' => 0,
'number_of_shards' => $this->helper->getNumberOfShards(),
'refresh_interval' => self::... | php | public function getCreateIndexSettings()
{
$settings = [
'requests.cache.enable' => true,
'number_of_replicas' => 0,
'number_of_shards' => $this->helper->getNumberOfShards(),
'refresh_interval' => self::... | [
"public",
"function",
"getCreateIndexSettings",
"(",
")",
"{",
"$",
"settings",
"=",
"[",
"'requests.cache.enable'",
"=>",
"true",
",",
"'number_of_replicas'",
"=>",
"0",
",",
"'number_of_shards'",
"=>",
"$",
"this",
"->",
"helper",
"->",
"getNumberOfShards",
"(",... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/IndexSettings.php#L130-L145 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/IndexSettings.php | IndexSettings.getInstallIndexSettings | public function getInstallIndexSettings()
{
$settings = [
'number_of_replicas' => $this->helper->getNumberOfReplicas(),
'refresh_interval' => self::DIFF_REINDEX_REFRESH_INTERVAL,
'translog.durability' => self::DIFF_REINDEX_TRANSLOG_DURABILITY,
];
... | php | public function getInstallIndexSettings()
{
$settings = [
'number_of_replicas' => $this->helper->getNumberOfReplicas(),
'refresh_interval' => self::DIFF_REINDEX_REFRESH_INTERVAL,
'translog.durability' => self::DIFF_REINDEX_TRANSLOG_DURABILITY,
];
... | [
"public",
"function",
"getInstallIndexSettings",
"(",
")",
"{",
"$",
"settings",
"=",
"[",
"'number_of_replicas'",
"=>",
"$",
"this",
"->",
"helper",
"->",
"getNumberOfReplicas",
"(",
")",
",",
"'refresh_interval'",
"=>",
"self",
"::",
"DIFF_REINDEX_REFRESH_INTERVAL... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/IndexSettings.php#L150-L159 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/IndexSettings.php | IndexSettings.getIndexConfig | public function getIndexConfig($indexIdentifier)
{
$indicesConfig = $this->getIndicesConfig();
if (!isset($indicesConfig[$indexIdentifier])) {
throw new \LogicException("No indices found with identifier {$indexIdentifier}");
}
return $indicesConfig[$indexIdentifier];
... | php | public function getIndexConfig($indexIdentifier)
{
$indicesConfig = $this->getIndicesConfig();
if (!isset($indicesConfig[$indexIdentifier])) {
throw new \LogicException("No indices found with identifier {$indexIdentifier}");
}
return $indicesConfig[$indexIdentifier];
... | [
"public",
"function",
"getIndexConfig",
"(",
"$",
"indexIdentifier",
")",
"{",
"$",
"indicesConfig",
"=",
"$",
"this",
"->",
"getIndicesConfig",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"indicesConfig",
"[",
"$",
"indexIdentifier",
"]",
")",
")",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/IndexSettings.php#L172-L181 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Structure/Element/Section/Visibility.php | Visibility.isVisible | public function isVisible(\Magento\Config\Model\Config\Structure\AbstractElement $element, $scope)
{
if (!$element->isAllowed()) {
return false;
}
$isVisible = parent::isVisible($element, $scope);
if ($isVisible) {
$isVisible = $element->hasChildren() || $el... | php | public function isVisible(\Magento\Config\Model\Config\Structure\AbstractElement $element, $scope)
{
if (!$element->isAllowed()) {
return false;
}
$isVisible = parent::isVisible($element, $scope);
if ($isVisible) {
$isVisible = $element->hasChildren() || $el... | [
"public",
"function",
"isVisible",
"(",
"\\",
"Magento",
"\\",
"Config",
"\\",
"Model",
"\\",
"Config",
"\\",
"Structure",
"\\",
"AbstractElement",
"$",
"element",
",",
"$",
"scope",
")",
"{",
"if",
"(",
"!",
"$",
"element",
"->",
"isAllowed",
"(",
")",
... | Check a configuration element visibility
@param \Magento\Config\Model\Config\Structure\AbstractElement $element The config composite element
@param string $scope The element scope
@return bool | [
"Check",
"a",
"configuration",
"element",
"visibility"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Structure/Element/Section/Visibility.php#L33-L46 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/Search.php | Search.search | public function search(\Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria)
{
$searchRequest = $this->searchRequestBuilder->getRequest($searchCriteria);
$searchResponse = $this->searchEngine->search($searchRequest);
$searchResult = $this->searchResponseBuilder->build($se... | php | public function search(\Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria)
{
$searchRequest = $this->searchRequestBuilder->getRequest($searchCriteria);
$searchResponse = $this->searchEngine->search($searchRequest);
$searchResult = $this->searchResponseBuilder->build($se... | [
"public",
"function",
"search",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Api",
"\\",
"Search",
"\\",
"SearchCriteriaInterface",
"$",
"searchCriteria",
")",
"{",
"$",
"searchRequest",
"=",
"$",
"this",
"->",
"searchRequestBuilder",
"->",
"getRequest",
"(",... | Execute search.
@param \Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria Search criteria.
@return \Magento\Framework\Api\Search\SearchResultInterface | [
"Execute",
"search",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search.php#L65-L76 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Search/Preview.php | Preview.prepareProductCollection | protected function prepareProductCollection(\Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection $collection)
{
$collection->setVisibility([Visibility::VISIBILITY_IN_SEARCH, Visibility::VISIBILITY_BOTH]);
$collection->setSearchQuery($this->searchQuery->getQueryText());
... | php | protected function prepareProductCollection(\Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection $collection)
{
$collection->setVisibility([Visibility::VISIBILITY_IN_SEARCH, Visibility::VISIBILITY_BOTH]);
$collection->setSearchQuery($this->searchQuery->getQueryText());
... | [
"protected",
"function",
"prepareProductCollection",
"(",
"\\",
"Smile",
"\\",
"ElasticsuiteCatalog",
"\\",
"Model",
"\\",
"ResourceModel",
"\\",
"Product",
"\\",
"Fulltext",
"\\",
"Collection",
"$",
"collection",
")",
"{",
"$",
"collection",
"->",
"setVisibility",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Search/Preview.php#L67-L73 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Plugin/ResultPlugin.php | ResultPlugin.aroundGetNoteMessages | public function aroundGetNoteMessages(Result $resultBlock, \Closure $proceed)
{
$messages = $proceed();
$query = $this->queryFactory->get();
$query->setNumResults($this->resultCount);
$query->setIsSpellchecked(false);
$isSpellcheck = $resultBlock->getListBlock()->getLoade... | php | public function aroundGetNoteMessages(Result $resultBlock, \Closure $proceed)
{
$messages = $proceed();
$query = $this->queryFactory->get();
$query->setNumResults($this->resultCount);
$query->setIsSpellchecked(false);
$isSpellcheck = $resultBlock->getListBlock()->getLoade... | [
"public",
"function",
"aroundGetNoteMessages",
"(",
"Result",
"$",
"resultBlock",
",",
"\\",
"Closure",
"$",
"proceed",
")",
"{",
"$",
"messages",
"=",
"$",
"proceed",
"(",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"queryFactory",
"->",
"get",
"(",... | Append the fuzziness alert message + save the search result count.
@SuppressWarnings(PHPMD.UnusedFormalParameter)
@param \Magento\CatalogSearch\Block\Result $resultBlock Result block.
@param \Closure $proceed Original method.
@return string[] | [
"Append",
"the",
"fuzziness",
"alert",
"message",
"+",
"save",
"the",
"search",
"result",
"count",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Plugin/ResultPlugin.php#L90-L112 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Plugin/ResultPlugin.php | ResultPlugin.aroundGetResultCount | public function aroundGetResultCount(Result $resultBlock, \Closure $proceed)
{
if ($this->resultCount === null) {
$size = $resultBlock->getListBlock()->getLoadedProductCollection()->getSize();
$this->resultCount = $size;
}
return $this->resultCount;
} | php | public function aroundGetResultCount(Result $resultBlock, \Closure $proceed)
{
if ($this->resultCount === null) {
$size = $resultBlock->getListBlock()->getLoadedProductCollection()->getSize();
$this->resultCount = $size;
}
return $this->resultCount;
} | [
"public",
"function",
"aroundGetResultCount",
"(",
"Result",
"$",
"resultBlock",
",",
"\\",
"Closure",
"$",
"proceed",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resultCount",
"===",
"null",
")",
"{",
"$",
"size",
"=",
"$",
"resultBlock",
"->",
"getListBlock... | Avoid the search result count to be saved by the original method.
@SuppressWarnings(PHPMD.UnusedFormalParameter)
@param \Magento\CatalogSearch\Block\Result $resultBlock Result block.
@param \Closure $proceed Original method.
@return integer | [
"Avoid",
"the",
"search",
"result",
"count",
"to",
"be",
"saved",
"by",
"the",
"original",
"method",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Plugin/ResultPlugin.php#L124-L132 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Plugin/ResultPlugin.php | ResultPlugin.aroundSetListOrders | public function aroundSetListOrders(Result $resultBlock, \Closure $proceed)
{
$proceed();
$resultBlock->getListBlock()->setDefaultDirection('asc');
return $resultBlock;
} | php | public function aroundSetListOrders(Result $resultBlock, \Closure $proceed)
{
$proceed();
$resultBlock->getListBlock()->setDefaultDirection('asc');
return $resultBlock;
} | [
"public",
"function",
"aroundSetListOrders",
"(",
"Result",
"$",
"resultBlock",
",",
"\\",
"Closure",
"$",
"proceed",
")",
"{",
"$",
"proceed",
"(",
")",
";",
"$",
"resultBlock",
"->",
"getListBlock",
"(",
")",
"->",
"setDefaultDirection",
"(",
"'asc'",
")",... | Change default behavior of the search result block.
Order has to be set to ASC and not DESC.
@param \Magento\CatalogSearch\Block\Result $resultBlock Result block.
@param \Closure $proceed Original method.
@return \Magento\CatalogSearch\Block\Result | [
"Change",
"default",
"behavior",
"of",
"the",
"search",
"result",
"block",
".",
"Order",
"has",
"to",
"be",
"set",
"to",
"ASC",
"and",
"not",
"DESC",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Plugin/ResultPlugin.php#L143-L149 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Rule.php | Rule.getCategorySearchQuery | public function getCategorySearchQuery($category, $excludedCategories = [])
{
$query = null;
if (!is_object($category)) {
$category = $this->categoryFactory->create()->setStoreId($this->getStoreId())->load($category);
}
if (!in_array($category->getId(), $exclude... | php | public function getCategorySearchQuery($category, $excludedCategories = [])
{
$query = null;
if (!is_object($category)) {
$category = $this->categoryFactory->create()->setStoreId($this->getStoreId())->load($category);
}
if (!in_array($category->getId(), $exclude... | [
"public",
"function",
"getCategorySearchQuery",
"(",
"$",
"category",
",",
"$",
"excludedCategories",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"null",
";",
"if",
"(",
"!",
"is_object",
"(",
"$",
"category",
")",
")",
"{",
"$",
"category",
"=",
"$",
... | Build search query by category.
@param \Magento\Catalog\Api\Data\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 categorie... | [
"Build",
"search",
"query",
"by",
"category",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Rule.php#L138-L160 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Rule.php | Rule.getSearchQueriesByChildren | public function getSearchQueriesByChildren(CategoryInterface $rootCategory)
{
$queries = [];
$childrenIds = $rootCategory->getResource()->getChildren($rootCategory, false);
if (!empty($childrenIds)) {
$storeId = $this->getStoreId();
$categoryCollection... | php | public function getSearchQueriesByChildren(CategoryInterface $rootCategory)
{
$queries = [];
$childrenIds = $rootCategory->getResource()->getChildren($rootCategory, false);
if (!empty($childrenIds)) {
$storeId = $this->getStoreId();
$categoryCollection... | [
"public",
"function",
"getSearchQueriesByChildren",
"(",
"CategoryInterface",
"$",
"rootCategory",
")",
"{",
"$",
"queries",
"=",
"[",
"]",
";",
"$",
"childrenIds",
"=",
"$",
"rootCategory",
"->",
"getResource",
"(",
")",
"->",
"getChildren",
"(",
"$",
"rootCa... | Retrieve search queries of children categories.
@param \Magento\Catalog\Api\Data\CategoryInterface $rootCategory Root category.
@return \Smile\ElasticsuiteCore\Search\Request\QueryInterface[] | [
"Retrieve",
"search",
"queries",
"of",
"children",
"categories",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Rule.php#L169-L193 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Rule.php | Rule.setCondition | public function setCondition($condition)
{
$this->getConditions()->setConditions([])->loadArray($this->dataModelToArray($condition));
return $this;
} | php | public function setCondition($condition)
{
$this->getConditions()->setConditions([])->loadArray($this->dataModelToArray($condition));
return $this;
} | [
"public",
"function",
"setCondition",
"(",
"$",
"condition",
")",
"{",
"$",
"this",
"->",
"getConditions",
"(",
")",
"->",
"setConditions",
"(",
"[",
"]",
")",
"->",
"loadArray",
"(",
"$",
"this",
"->",
"dataModelToArray",
"(",
"$",
"condition",
")",
")"... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Rule.php#L208-L213 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Rule.php | Rule.getVirtualRootCategory | private function getVirtualRootCategory(CategoryInterface $category)
{
$storeId = $this->getStoreId();
$rootCategory = $this->categoryFactory->create()->setStoreId($storeId);
if ($category->getVirtualCategoryRoot() !== null && !empty($category->getVirtualCategoryRoot())) {
... | php | private function getVirtualRootCategory(CategoryInterface $category)
{
$storeId = $this->getStoreId();
$rootCategory = $this->categoryFactory->create()->setStoreId($storeId);
if ($category->getVirtualCategoryRoot() !== null && !empty($category->getVirtualCategoryRoot())) {
... | [
"private",
"function",
"getVirtualRootCategory",
"(",
"CategoryInterface",
"$",
"category",
")",
"{",
"$",
"storeId",
"=",
"$",
"this",
"->",
"getStoreId",
"(",
")",
";",
"$",
"rootCategory",
"=",
"$",
"this",
"->",
"categoryFactory",
"->",
"create",
"(",
")... | Load the root category used for a virtual category.
@param CategoryInterface $category Virtual category.
@return CategoryInterface | [
"Load",
"the",
"root",
"category",
"used",
"for",
"a",
"virtual",
"category",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Rule.php#L222-L239 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Rule.php | Rule.getStandardCategoriesQuery | private function getStandardCategoriesQuery(array $categoryIds, $excludedCategories)
{
$conditionsParams = ['data' => ['attribute' => 'category_ids', 'operator' => '()', 'value' => $categoryIds]];
$categoryCondition = $this->productConditionsFactory->create($conditionsParams);
return $this... | php | private function getStandardCategoriesQuery(array $categoryIds, $excludedCategories)
{
$conditionsParams = ['data' => ['attribute' => 'category_ids', 'operator' => '()', 'value' => $categoryIds]];
$categoryCondition = $this->productConditionsFactory->create($conditionsParams);
return $this... | [
"private",
"function",
"getStandardCategoriesQuery",
"(",
"array",
"$",
"categoryIds",
",",
"$",
"excludedCategories",
")",
"{",
"$",
"conditionsParams",
"=",
"[",
"'data'",
"=>",
"[",
"'attribute'",
"=>",
"'category_ids'",
",",
"'operator'",
"=>",
"'()'",
",",
... | Transform a category ids list in query rule.
@param array $categoryIds Categories included in the query.
@param array $excludedCategories Categories ignored in subquery filters.
@return QueryInterface | [
"Transform",
"a",
"category",
"ids",
"list",
"in",
"query",
"rule",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Rule.php#L262-L268 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Rule.php | Rule.getVirtualCategoryQuery | private function getVirtualCategoryQuery(CategoryInterface $category, $excludedCategories = [])
{
$query = $category->getVirtualRule()->getConditions()->getSearchQuery($excludedCategories);
$parentCategory = $this->getVirtualRootCategory($category);
if ($parentCategory && in_array(... | php | private function getVirtualCategoryQuery(CategoryInterface $category, $excludedCategories = [])
{
$query = $category->getVirtualRule()->getConditions()->getSearchQuery($excludedCategories);
$parentCategory = $this->getVirtualRootCategory($category);
if ($parentCategory && in_array(... | [
"private",
"function",
"getVirtualCategoryQuery",
"(",
"CategoryInterface",
"$",
"category",
",",
"$",
"excludedCategories",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"$",
"category",
"->",
"getVirtualRule",
"(",
")",
"->",
"getConditions",
"(",
")",
"->",
... | Transform the virtual category into a QueryInterface used for filtering.
@param CategoryInterface $category Virtual category.
@param array $excludedCategories Category already used into the building stack. Avoid short circuit.
@return QueryInterface | [
"Transform",
"the",
"virtual",
"category",
"into",
"a",
"QueryInterface",
"used",
"for",
"filtering",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Rule.php#L278-L293 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Rule.php | Rule.addChildrenQueries | private function addChildrenQueries($query, CategoryInterface $category, $excludedCategories = [])
{
$childrenCategories = $this->getChildrenCategories($category, $excludedCategories);
$childrenCategoriesIds = [];
if ($childrenCategories->getSize() > 0 && $query !== null) {
$... | php | private function addChildrenQueries($query, CategoryInterface $category, $excludedCategories = [])
{
$childrenCategories = $this->getChildrenCategories($category, $excludedCategories);
$childrenCategoriesIds = [];
if ($childrenCategories->getSize() > 0 && $query !== null) {
$... | [
"private",
"function",
"addChildrenQueries",
"(",
"$",
"query",
",",
"CategoryInterface",
"$",
"category",
",",
"$",
"excludedCategories",
"=",
"[",
"]",
")",
"{",
"$",
"childrenCategories",
"=",
"$",
"this",
"->",
"getChildrenCategories",
"(",
"$",
"category",
... | Append children queries to the rule.
@SuppressWarnings(PHPMD.ElseExpression)
@param QueryInterface|NULL $query Base query.
@param CategoryInterface $category Current cayegory.
@param array $excludedCategories Category already used into the building stack. Avoid short circuit.
@... | [
"Append",
"children",
"queries",
"to",
"the",
"rule",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Rule.php#L306-L335 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Rule.php | Rule.getChildrenCategories | private function getChildrenCategories(CategoryInterface $category, $excludedCategories = [])
{
$storeId = $category->getStoreId();
$categoryCollection = $this->categoryCollectionFactory->create()->setStoreId($storeId);
$categoryCollection->addIsActiveFilter()->addPathFilter(spri... | php | private function getChildrenCategories(CategoryInterface $category, $excludedCategories = [])
{
$storeId = $category->getStoreId();
$categoryCollection = $this->categoryCollectionFactory->create()->setStoreId($storeId);
$categoryCollection->addIsActiveFilter()->addPathFilter(spri... | [
"private",
"function",
"getChildrenCategories",
"(",
"CategoryInterface",
"$",
"category",
",",
"$",
"excludedCategories",
"=",
"[",
"]",
")",
"{",
"$",
"storeId",
"=",
"$",
"category",
"->",
"getStoreId",
"(",
")",
";",
"$",
"categoryCollection",
"=",
"$",
... | Returns the list of the virtual categories available under a category.
@param CategoryInterface $category Category.
@param array $excludedCategories Category already used into the building stack. Avoid short circuit.
@return \Magento\Catalog\Model\ResourceModel\Category\Collection; | [
"Returns",
"the",
"list",
"of",
"the",
"virtual",
"categories",
"available",
"under",
"a",
"category",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Rule.php#L345-L363 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Rule.php | Rule.getRootCategoryId | private function getRootCategoryId($store)
{
if (is_numeric($store) || is_string($store)) {
$store = $this->storeManager->getStore($store);
} elseif ($store === null) {
$store = $this->storeManager->getStore();
}
$storeGroupId = $store->getStoreGroupId();
... | php | private function getRootCategoryId($store)
{
if (is_numeric($store) || is_string($store)) {
$store = $this->storeManager->getStore($store);
} elseif ($store === null) {
$store = $this->storeManager->getStore();
}
$storeGroupId = $store->getStoreGroupId();
... | [
"private",
"function",
"getRootCategoryId",
"(",
"$",
"store",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"store",
")",
"||",
"is_string",
"(",
"$",
"store",
")",
")",
"{",
"$",
"store",
"=",
"$",
"this",
"->",
"storeManager",
"->",
"getStore",
"(",
... | Retrieve store root category id.
@param \Magento\Store\Api\Data\StoreInterface|int|string $store Store id.
@return integer | [
"Retrieve",
"store",
"root",
"category",
"id",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Rule.php#L372-L383 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Reader/DefaultReader.php | DefaultReader.read | public function read($scope = null)
{
$scope = $scope === null ? ContainerScopeInterface::SCOPE_DEFAULT : $scope;
if ($scope !== ContainerScopeInterface::SCOPE_DEFAULT) {
throw new \Magento\Framework\Exception\LocalizedException(__("Only default scope allowed"));
}
$conf... | php | public function read($scope = null)
{
$scope = $scope === null ? ContainerScopeInterface::SCOPE_DEFAULT : $scope;
if ($scope !== ContainerScopeInterface::SCOPE_DEFAULT) {
throw new \Magento\Framework\Exception\LocalizedException(__("Only default scope allowed"));
}
$conf... | [
"public",
"function",
"read",
"(",
"$",
"scope",
"=",
"null",
")",
"{",
"$",
"scope",
"=",
"$",
"scope",
"===",
"null",
"?",
"ContainerScopeInterface",
"::",
"SCOPE_DEFAULT",
":",
"$",
"scope",
";",
"if",
"(",
"$",
"scope",
"!==",
"ContainerScopeInterface"... | Read configuration data
@param null|string $scope The current scope to load (default)
@return array Exception is thrown when scope other than default is given
@throws \Magento\Framework\Exception\LocalizedException | [
"Read",
"configuration",
"data"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Reader/DefaultReader.php#L68-L90 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Controller/Adminhtml/Search/Request/RelevanceConfig/AbstractScopeConfig.php | AbstractScopeConfig.isSectionAllowed | protected function isSectionAllowed($sectionId)
{
$container = $this->getRequest()->getParam('container');
$store = $this->getRequest()->getParam('store');
if ($store) {
$this->backendConfig->setStore($store);
} elseif ($container) {
$this->backendConfig->setC... | php | protected function isSectionAllowed($sectionId)
{
$container = $this->getRequest()->getParam('container');
$store = $this->getRequest()->getParam('store');
if ($store) {
$this->backendConfig->setStore($store);
} elseif ($container) {
$this->backendConfig->setC... | [
"protected",
"function",
"isSectionAllowed",
"(",
"$",
"sectionId",
")",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",
"'container'",
")",
";",
"$",
"store",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
... | Sets scope for backend config
@param string $sectionId The section being viewed/edited/saved
@return bool | [
"Sets",
"scope",
"for",
"backend",
"config"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Controller/Adminhtml/Search/Request/RelevanceConfig/AbstractScopeConfig.php#L61-L72 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Delete.php | Delete.execute | public function execute()
{
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultRedirectFactory->create();
$identifier = $this->getRequest()->getParam('id', false);
$model = $this->optimizerFactory->create();
if ($identifier... | php | public function execute()
{
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultRedirectFactory->create();
$identifier = $this->getRequest()->getParam('id', false);
$model = $this->optimizerFactory->create();
if ($identifier... | [
"public",
"function",
"execute",
"(",
")",
"{",
"/** @var \\Magento\\Backend\\Model\\View\\Result\\Redirect $resultRedirect */",
"$",
"resultRedirect",
"=",
"$",
"this",
"->",
"resultRedirectFactory",
"->",
"create",
"(",
")",
";",
"$",
"identifier",
"=",
"$",
"this",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Delete.php#L31-L57 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Setup/UpgradeSchema.php | UpgradeSchema.upgrade | public function upgrade(
SchemaSetupInterface $setup,
ModuleContextInterface $context
) {
$setup->startSetup();
if (version_compare($context->getVersion(), '1.1.0', '<')) {
$this->catalogSetup->appendDecimalDisplayConfiguration($setup);
}
if (version_com... | php | public function upgrade(
SchemaSetupInterface $setup,
ModuleContextInterface $context
) {
$setup->startSetup();
if (version_compare($context->getVersion(), '1.1.0', '<')) {
$this->catalogSetup->appendDecimalDisplayConfiguration($setup);
}
if (version_com... | [
"public",
"function",
"upgrade",
"(",
"SchemaSetupInterface",
"$",
"setup",
",",
"ModuleContextInterface",
"$",
"context",
")",
"{",
"$",
"setup",
"->",
"startSetup",
"(",
")",
";",
"if",
"(",
"version_compare",
"(",
"$",
"context",
"->",
"getVersion",
"(",
... | Installs DB schema for a module
@param SchemaSetupInterface $setup Setup
@param ModuleContextInterface $context Context
@return void | [
"Installs",
"DB",
"schema",
"for",
"a",
"module"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Setup/UpgradeSchema.php#L52-L84 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Attribute/Source/FilterSortOrder.php | FilterSortOrder.toOptionArray | public function toOptionArray()
{
return [
['value' => BucketInterface::SORT_ORDER_COUNT, 'label' => __('Result count')],
['value' => BucketInterface::SORT_ORDER_MANUAL, 'label' => __('Admin sort')],
['value' => BucketInterface::SORT_ORDER_TERM, 'label' => __('Name')],
... | php | public function toOptionArray()
{
return [
['value' => BucketInterface::SORT_ORDER_COUNT, 'label' => __('Result count')],
['value' => BucketInterface::SORT_ORDER_MANUAL, 'label' => __('Admin sort')],
['value' => BucketInterface::SORT_ORDER_TERM, 'label' => __('Name')],
... | [
"public",
"function",
"toOptionArray",
"(",
")",
"{",
"return",
"[",
"[",
"'value'",
"=>",
"BucketInterface",
"::",
"SORT_ORDER_COUNT",
",",
"'label'",
"=>",
"__",
"(",
"'Result count'",
")",
"]",
",",
"[",
"'value'",
"=>",
"BucketInterface",
"::",
"SORT_ORDER... | Return array of available sort order
@return array | [
"Return",
"array",
"of",
"available",
"sort",
"order"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Attribute/Source/FilterSortOrder.php#L33-L41 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.