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/Model/ResourceModel/Search/Request/RelevanceConfig/Data/Collection.php
Collection.addScopeFilter
public function addScopeFilter($scope, $scopeCode, $section) { $this->addFieldToFilter('scope', $scope); $this->addFieldToFilter('scope_code', trim($scopeCode)); $this->addFieldToFilter('path', ['like' => $section . '/%']); return $this; }
php
public function addScopeFilter($scope, $scopeCode, $section) { $this->addFieldToFilter('scope', $scope); $this->addFieldToFilter('scope_code', trim($scopeCode)); $this->addFieldToFilter('path', ['like' => $section . '/%']); return $this; }
[ "public", "function", "addScopeFilter", "(", "$", "scope", ",", "$", "scopeCode", ",", "$", "section", ")", "{", "$", "this", "->", "addFieldToFilter", "(", "'scope'", ",", "$", "scope", ")", ";", "$", "this", "->", "addFieldToFilter", "(", "'scope_code'",...
Add scope filter to collection @param string $scope The scope @param string $scopeCode The scope code @param string $section The section @return Collection
[ "Add", "scope", "filter", "to", "collection" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/ResourceModel/Search/Request/RelevanceConfig/Data/Collection.php#L35-L42
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Ui/Component/Optimizer/Listing/DataProvider.php
DataProvider.addField
public function addField($field, $alias = null) { if (isset($this->addFieldStrategies[$field])) { $this->addFieldStrategies[$field]->addField($this->getCollection(), $field, $alias); return ; } parent::addField($field, $alias); }
php
public function addField($field, $alias = null) { if (isset($this->addFieldStrategies[$field])) { $this->addFieldStrategies[$field]->addField($this->getCollection(), $field, $alias); return ; } parent::addField($field, $alias); }
[ "public", "function", "addField", "(", "$", "field", ",", "$", "alias", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "addFieldStrategies", "[", "$", "field", "]", ")", ")", "{", "$", "this", "->", "addFieldStrategies", "[", "$",...
Add field to select @param string|array $field The field @param string|null $alias Alias for the field @return void
[ "Add", "field", "to", "select" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Ui/Component/Optimizer/Listing/DataProvider.php#L82-L90
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Ui/Component/Optimizer/Listing/DataProvider.php
DataProvider.addFilter
public function addFilter(\Magento\Framework\Api\Filter $filter) { if (isset($this->addFilterStrategies[$filter->getField()])) { $this->addFilterStrategies[$filter->getField()] ->addFilter( $this->getCollection(), $filter->getField(), ...
php
public function addFilter(\Magento\Framework\Api\Filter $filter) { if (isset($this->addFilterStrategies[$filter->getField()])) { $this->addFilterStrategies[$filter->getField()] ->addFilter( $this->getCollection(), $filter->getField(), ...
[ "public", "function", "addFilter", "(", "\\", "Magento", "\\", "Framework", "\\", "Api", "\\", "Filter", "$", "filter", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "addFilterStrategies", "[", "$", "filter", "->", "getField", "(", ")", "]", ")...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Ui/Component/Optimizer/Listing/DataProvider.php#L95-L108
Smile-SA/elasticsuite
src/module-elasticsuite-core/Index/Indices/Config.php
Config.reset
public function reset() { parent::reset(); $this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [$this->cacheId]); }
php
public function reset() { parent::reset(); $this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [$this->cacheId]); }
[ "public", "function", "reset", "(", ")", "{", "parent", "::", "reset", "(", ")", ";", "$", "this", "->", "cache", "->", "clean", "(", "\\", "Zend_Cache", "::", "CLEANING_MODE_MATCHING_TAG", ",", "[", "$", "this", "->", "cacheId", "]", ")", ";", "}" ]
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Indices/Config.php#L121-L125
Smile-SA/elasticsuite
src/module-elasticsuite-core/Index/Indices/Config.php
Config.initData
protected function initData() { parent::initData(); array_walk($this->_data, function (&$indexConfigData, $indexName) { $indexConfigData = $this->initIndexConfig($indexName, $indexConfigData); }); }
php
protected function initData() { parent::initData(); array_walk($this->_data, function (&$indexConfigData, $indexName) { $indexConfigData = $this->initIndexConfig($indexName, $indexConfigData); }); }
[ "protected", "function", "initData", "(", ")", "{", "parent", "::", "initData", "(", ")", ";", "array_walk", "(", "$", "this", "->", "_data", ",", "function", "(", "&", "$", "indexConfigData", ",", "$", "indexName", ")", "{", "$", "indexConfigData", "=",...
Init data for configuration. @return void
[ "Init", "data", "for", "configuration", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Indices/Config.php#L132-L138
Smile-SA/elasticsuite
src/module-elasticsuite-core/Index/Indices/Config.php
Config.initIndexConfig
private function initIndexConfig(string $indexName, array $indexConfigData) { $types = []; foreach ($indexConfigData['types'] as $typeName => $typeConfigData) { $fields = $this->getMappingFields($indexName, $typeConfigData); $mapping = $this->mappingFactory->create( ...
php
private function initIndexConfig(string $indexName, array $indexConfigData) { $types = []; foreach ($indexConfigData['types'] as $typeName => $typeConfigData) { $fields = $this->getMappingFields($indexName, $typeConfigData); $mapping = $this->mappingFactory->create( ...
[ "private", "function", "initIndexConfig", "(", "string", "$", "indexName", ",", "array", "$", "indexConfigData", ")", "{", "$", "types", "=", "[", "]", ";", "foreach", "(", "$", "indexConfigData", "[", "'types'", "]", "as", "$", "typeName", "=>", "$", "t...
Init type, mapping, and fields from a index configuration array. @param string $indexName Processed index name. @param array $indexConfigData Processed index configuration. @return array
[ "Init", "type", "mapping", "and", "fields", "from", "a", "index", "configuration", "array", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Indices/Config.php#L148-L175
Smile-SA/elasticsuite
src/module-elasticsuite-core/Index/Indices/Config.php
Config.getMappingFields
private function getMappingFields($indexName, $typeConfigData) { \Magento\Framework\Profiler::start('ES:Get dynamic fields config'); $fields = $this->getDynamicFields($indexName, $typeConfigData); \Magento\Framework\Profiler::stop('ES:Get dynamic fields config'); foreach ($typeConfi...
php
private function getMappingFields($indexName, $typeConfigData) { \Magento\Framework\Profiler::start('ES:Get dynamic fields config'); $fields = $this->getDynamicFields($indexName, $typeConfigData); \Magento\Framework\Profiler::stop('ES:Get dynamic fields config'); foreach ($typeConfi...
[ "private", "function", "getMappingFields", "(", "$", "indexName", ",", "$", "typeConfigData", ")", "{", "\\", "Magento", "\\", "Framework", "\\", "Profiler", "::", "start", "(", "'ES:Get dynamic fields config'", ")", ";", "$", "fields", "=", "$", "this", "->",...
Prepare mapping fields by merging static fields with dynamic ones. @SuppressWarnings(PHPMD.StaticAccess) @param string $indexName Index Name. @param array $typeConfigData Processed type configuration. @return \Smile\ElasticsuiteCore\Api\Index\Mapping\FieldInterface[]
[ "Prepare", "mapping", "fields", "by", "merging", "static", "fields", "with", "dynamic", "ones", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Indices/Config.php#L187-L207
Smile-SA/elasticsuite
src/module-elasticsuite-core/Index/Indices/Config.php
Config.getDynamicFields
private function getDynamicFields($indexName, $configData) { $fields = []; $cacheId = implode('|', [$this->cacheId, $indexName]); $fieldsConfig = $this->cache->load($cacheId); if (false === $fieldsConfig) { $legacyDataSources = [$indexName => $configData['data...
php
private function getDynamicFields($indexName, $configData) { $fields = []; $cacheId = implode('|', [$this->cacheId, $indexName]); $fieldsConfig = $this->cache->load($cacheId); if (false === $fieldsConfig) { $legacyDataSources = [$indexName => $configData['data...
[ "private", "function", "getDynamicFields", "(", "$", "indexName", ",", "$", "configData", ")", "{", "$", "fields", "=", "[", "]", ";", "$", "cacheId", "=", "implode", "(", "'|'", ",", "[", "$", "this", "->", "cacheId", ",", "$", "indexName", "]", ")"...
Get dynamic fields. @SuppressWarnings(PHPMD.ElseExpression) @param string $indexName Index Name. @param array $configData Processed configuration. @return \Smile\ElasticsuiteCore\Api\Index\Mapping\FieldInterface[]
[ "Get", "dynamic", "fields", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Indices/Config.php#L219-L256
Smile-SA/elasticsuite
src/module-elasticsuite-swatches/Model/Plugin/ProductSubstitute.php
ProductSubstitute.aroundGetFilterArray
public function aroundGetFilterArray( \Magento\Swatches\Model\ProductSubstitute $productSubstitute, \Closure $proceed, array $request ) { $filterArray = $proceed($request); $attributeCodes = $this->eavConfig->getEntityAttributeCodes(\Magento\Catalog\Model\Product::ENTITY); ...
php
public function aroundGetFilterArray( \Magento\Swatches\Model\ProductSubstitute $productSubstitute, \Closure $proceed, array $request ) { $filterArray = $proceed($request); $attributeCodes = $this->eavConfig->getEntityAttributeCodes(\Magento\Catalog\Model\Product::ENTITY); ...
[ "public", "function", "aroundGetFilterArray", "(", "\\", "Magento", "\\", "Swatches", "\\", "Model", "\\", "ProductSubstitute", "$", "productSubstitute", ",", "\\", "Closure", "$", "proceed", ",", "array", "$", "request", ")", "{", "$", "filterArray", "=", "$"...
Build proper array for swatches rendering. Especially in product listing where values may come as label instead of option Ids. @param \Magento\Swatches\Model\ProductSubstitute $productSubstitute Original ProductSubstitute class @param \Closure $proceed ProductSubstitute::getF...
[ "Build", "proper", "array", "for", "swatches", "rendering", ".", "Especially", "in", "product", "listing", "where", "values", "may", "come", "as", "label", "instead", "of", "option", "Ids", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-swatches/Model/Plugin/ProductSubstitute.php#L60-L84
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Layer/Filter/Attribute.php
Attribute.apply
public function apply(\Magento\Framework\App\RequestInterface $request) { $attributeValue = $request->getParam($this->_requestVar); if (null !== $attributeValue) { if (!is_array($attributeValue)) { $attributeValue = [$attributeValue]; } $this->cu...
php
public function apply(\Magento\Framework\App\RequestInterface $request) { $attributeValue = $request->getParam($this->_requestVar); if (null !== $attributeValue) { if (!is_array($attributeValue)) { $attributeValue = [$attributeValue]; } $this->cu...
[ "public", "function", "apply", "(", "\\", "Magento", "\\", "Framework", "\\", "App", "\\", "RequestInterface", "$", "request", ")", "{", "$", "attributeValue", "=", "$", "request", "->", "getParam", "(", "$", "this", "->", "_requestVar", ")", ";", "if", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Attribute.php#L92-L116
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Layer/Filter/Attribute.php
Attribute._getItemsData
protected function _getItemsData() { /** @var \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $productCollection */ $productCollection = $this->getLayer()->getProductCollection(); $optionsFacetedData = $productCollection->getFacetedData($this->getFilterField()); $item...
php
protected function _getItemsData() { /** @var \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $productCollection */ $productCollection = $this->getLayer()->getProductCollection(); $optionsFacetedData = $productCollection->getFacetedData($this->getFilterField()); $item...
[ "protected", "function", "_getItemsData", "(", ")", "{", "/** @var \\Magento\\CatalogSearch\\Model\\ResourceModel\\Fulltext\\Collection $productCollection */", "$", "productCollection", "=", "$", "this", "->", "getLayer", "(", ")", "->", "getProductCollection", "(", ")", ";",...
@SuppressWarnings(PHPMD.CamelCaseMethodName) @SuppressWarnings(PHPMD.ElseExpression) {@inheritDoc}
[ "@SuppressWarnings", "(", "PHPMD", ".", "CamelCaseMethodName", ")", "@SuppressWarnings", "(", "PHPMD", ".", "ElseExpression", ")" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Attribute.php#L134-L162
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Layer/Filter/Attribute.php
Attribute._initItems
protected function _initItems() { parent::_initItems(); foreach ($this->_items as $item) { $applyValue = $item->getLabel(); if (($valuePos = array_search($applyValue, $this->currentFilterValue)) !== false) { $item->setIsSelected(true); $applyV...
php
protected function _initItems() { parent::_initItems(); foreach ($this->_items as $item) { $applyValue = $item->getLabel(); if (($valuePos = array_search($applyValue, $this->currentFilterValue)) !== false) { $item->setIsSelected(true); $applyV...
[ "protected", "function", "_initItems", "(", ")", "{", "parent", "::", "_initItems", "(", ")", ";", "foreach", "(", "$", "this", "->", "_items", "as", "$", "item", ")", "{", "$", "applyValue", "=", "$", "item", "->", "getLabel", "(", ")", ";", "if", ...
@SuppressWarnings(PHPMD.CamelCaseMethodName) @SuppressWarnings(PHPMD.ElseExpression) {@inheritDoc}
[ "@SuppressWarnings", "(", "PHPMD", ".", "CamelCaseMethodName", ")", "@SuppressWarnings", "(", "PHPMD", ".", "ElseExpression", ")" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Attribute.php#L170-L188
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Layer/Filter/Attribute.php
Attribute.addOptionsData
private function addOptionsData(array $items) { if ($this->getAttributeModel()->getFacetSortOrder() == BucketInterface::SORT_ORDER_MANUAL) { $options = $this->getAttributeModel()->getFrontend()->getSelectOptions(); $optionPosition = 0; if (!empty($options)) { ...
php
private function addOptionsData(array $items) { if ($this->getAttributeModel()->getFacetSortOrder() == BucketInterface::SORT_ORDER_MANUAL) { $options = $this->getAttributeModel()->getFrontend()->getSelectOptions(); $optionPosition = 0; if (!empty($options)) { ...
[ "private", "function", "addOptionsData", "(", "array", "$", "items", ")", "{", "if", "(", "$", "this", "->", "getAttributeModel", "(", ")", "->", "getFacetSortOrder", "(", ")", "==", "BucketInterface", "::", "SORT_ORDER_MANUAL", ")", "{", "$", "options", "="...
Resort items according option position defined in admin. @param array $items Items to be sorted. @return array
[ "Resort", "items", "according", "option", "position", "defined", "in", "admin", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Attribute.php#L207-L232
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Layer/Filter/Attribute.php
Attribute.sortOptionsData
private function sortOptionsData(array $items) { usort($items, function ($item1, $item2) { if (!isset($item1['adminSortIndex']) or !isset($item2['adminSortIndex'])) { return 0; } return $item1['adminSortIndex'] <= $item2['adminSortIndex'] ? -1 : 1; ...
php
private function sortOptionsData(array $items) { usort($items, function ($item1, $item2) { if (!isset($item1['adminSortIndex']) or !isset($item2['adminSortIndex'])) { return 0; } return $item1['adminSortIndex'] <= $item2['adminSortIndex'] ? -1 : 1; ...
[ "private", "function", "sortOptionsData", "(", "array", "$", "items", ")", "{", "usort", "(", "$", "items", ",", "function", "(", "$", "item1", ",", "$", "item2", ")", "{", "if", "(", "!", "isset", "(", "$", "item1", "[", "'adminSortIndex'", "]", ")"...
Sort items by adminSortIndex key. @param array $items to be sorted. @return array
[ "Sort", "items", "by", "adminSortIndex", "key", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Attribute.php#L241-L253
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Block/Adminhtml/Optimizer/RuleCondition.php
RuleCondition.getForm
private function getForm() { $rule = $this->ruleFactory->create(); if ($this->getOptimizer() && $this->getOptimizer()->getRuleCondition()) { $rule = $this->getOptimizer()->getRuleCondition(); } $form = $this->formFactory->create(); $form->setHtmlId('rule_conditi...
php
private function getForm() { $rule = $this->ruleFactory->create(); if ($this->getOptimizer() && $this->getOptimizer()->getRuleCondition()) { $rule = $this->getOptimizer()->getRuleCondition(); } $form = $this->formFactory->create(); $form->setHtmlId('rule_conditi...
[ "private", "function", "getForm", "(", ")", "{", "$", "rule", "=", "$", "this", "->", "ruleFactory", "->", "create", "(", ")", ";", "if", "(", "$", "this", "->", "getOptimizer", "(", ")", "&&", "$", "this", "->", "getOptimizer", "(", ")", "->", "ge...
Create the form containing the rule field. @return \Magento\Framework\Data\Form
[ "Create", "the", "form", "containing", "the", "rule", "field", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Block/Adminhtml/Optimizer/RuleCondition.php#L92-L114
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/SearchPositionData.php
SearchPositionData.addData
public function addData($storeId, array $indexData) { $productIds = array_keys($indexData); $searchPositions = $this->resourceModel->getByProductIds($productIds, $storeId); foreach ($searchPositions as $currentPosition) { $data = [ 'query_id' => (int) $curr...
php
public function addData($storeId, array $indexData) { $productIds = array_keys($indexData); $searchPositions = $this->resourceModel->getByProductIds($productIds, $storeId); foreach ($searchPositions as $currentPosition) { $data = [ 'query_id' => (int) $curr...
[ "public", "function", "addData", "(", "$", "storeId", ",", "array", "$", "indexData", ")", "{", "$", "productIds", "=", "array_keys", "(", "$", "indexData", ")", ";", "$", "searchPositions", "=", "$", "this", "->", "resourceModel", "->", "getByProductIds", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/SearchPositionData.php#L47-L63
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Ui/Component/Optimizer/Form/Modifier/Limitation.php
Limitation.modifyData
public function modifyData(array $data) { $optimizer = $this->locator->getOptimizer(); if ($optimizer && $optimizer->getId() && isset($data[$optimizer->getId()])) { $searchContainers = $optimizer->getSearchContainers(); $data[$optimizer->getId()]['search_container'] = array...
php
public function modifyData(array $data) { $optimizer = $this->locator->getOptimizer(); if ($optimizer && $optimizer->getId() && isset($data[$optimizer->getId()])) { $searchContainers = $optimizer->getSearchContainers(); $data[$optimizer->getId()]['search_container'] = array...
[ "public", "function", "modifyData", "(", "array", "$", "data", ")", "{", "$", "optimizer", "=", "$", "this", "->", "locator", "->", "getOptimizer", "(", ")", ";", "if", "(", "$", "optimizer", "&&", "$", "optimizer", "->", "getId", "(", ")", "&&", "is...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Ui/Component/Optimizer/Form/Modifier/Limitation.php#L53-L88
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Model/Search/Request/Product/Source/Containers.php
Containers.toOptionArray
public function toOptionArray() { $options = []; foreach ($this->getContainers() as $container) { if (isset($container['type']) && ($container['type'] === self::TYPE_PRODUCT)) { $options[] = [ 'value' => $container['name'], 'labe...
php
public function toOptionArray() { $options = []; foreach ($this->getContainers() as $container) { if (isset($container['type']) && ($container['type'] === self::TYPE_PRODUCT)) { $options[] = [ 'value' => $container['name'], 'labe...
[ "public", "function", "toOptionArray", "(", ")", "{", "$", "options", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "getContainers", "(", ")", "as", "$", "container", ")", "{", "if", "(", "isset", "(", "$", "container", "[", "'type'", "]", ...
Return array of options as value-label pairs @return array Format: array(array('value' => '<value>', 'label' => '<label>'), ...)
[ "Return", "array", "of", "options", "as", "value", "-", "label", "pairs" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Search/Request/Product/Source/Containers.php#L35-L49
Smile-SA/elasticsuite
src/module-elasticsuite-virtual-category/Plugin/Catalog/Category/FlatPlugin.php
FlatPlugin.aroundLoad
public function aroundLoad(FlatResource $categoryResource, \Closure $proceed, $category, $value, $field = null) { $proceed($category, $value, $field); if ($category->getVirtualRule() == null || is_string($category->getVirtualRule())) { $this->readHandler->execute($category); } ...
php
public function aroundLoad(FlatResource $categoryResource, \Closure $proceed, $category, $value, $field = null) { $proceed($category, $value, $field); if ($category->getVirtualRule() == null || is_string($category->getVirtualRule())) { $this->readHandler->execute($category); } ...
[ "public", "function", "aroundLoad", "(", "FlatResource", "$", "categoryResource", ",", "\\", "Closure", "$", "proceed", ",", "$", "category", ",", "$", "value", ",", "$", "field", "=", "null", ")", "{", "$", "proceed", "(", "$", "category", ",", "$", "...
Process correct loading of virtual rule when loading a category via the Flat Resource Built around load() method because the afterLoad() Resource method is only triggered when using the EntityManager, and is not triggered when calling load() method on model explicitely. @SuppressWarnings(PHPMD.UnusedFormalParameter) ...
[ "Process", "correct", "loading", "of", "virtual", "rule", "when", "loading", "a", "category", "via", "the", "Flat", "Resource", "Built", "around", "load", "()", "method", "because", "the", "afterLoad", "()", "Resource", "method", "is", "only", "triggered", "wh...
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Plugin/Catalog/Category/FlatPlugin.php#L57-L64
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php
Converter.convert
public function convert($source) { // Due to SimpleXML not deleting comment we have to strip them before using the source. $source = $this->stripComments($source); /** @var \DOMNodeList $requestNodes */ $requestNodes = $source->getElementsByTagName('request'); $xpath ...
php
public function convert($source) { // Due to SimpleXML not deleting comment we have to strip them before using the source. $source = $this->stripComments($source); /** @var \DOMNodeList $requestNodes */ $requestNodes = $source->getElementsByTagName('request'); $xpath ...
[ "public", "function", "convert", "(", "$", "source", ")", "{", "// Due to SimpleXML not deleting comment we have to strip them before using the source.", "$", "source", "=", "$", "this", "->", "stripComments", "(", "$", "source", ")", ";", "/** @var \\DOMNodeList $requestNo...
Convert config. @param \DOMDocument $source XML file read. @return array
[ "Convert", "config", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php#L73-L95
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php
Converter.stripComments
private function stripComments(\DOMDocument $source) { $xpath = new \DOMXPath($source); foreach ($xpath->query('//comment()') as $commentNode) { $commentNode->parentNode->removeChild($commentNode); } return $source; }
php
private function stripComments(\DOMDocument $source) { $xpath = new \DOMXPath($source); foreach ($xpath->query('//comment()') as $commentNode) { $commentNode->parentNode->removeChild($commentNode); } return $source; }
[ "private", "function", "stripComments", "(", "\\", "DOMDocument", "$", "source", ")", "{", "$", "xpath", "=", "new", "\\", "DOMXPath", "(", "$", "source", ")", ";", "foreach", "(", "$", "xpath", "->", "query", "(", "'//comment()'", ")", "as", "$", "com...
This method remove all comments of an XML document. @param \DOMDocument $source Document to be cleansed. @return \DOMDocument
[ "This", "method", "remove", "all", "comments", "of", "an", "XML", "document", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php#L104-L113
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php
Converter.parseFilters
private function parseFilters(\DOMXPath $xpath, \DOMNode $requestRootNode) { $filters = []; foreach ($xpath->query(self::FILTERS_PATH, $requestRootNode) as $filterNode) { $filters[$filterNode->getAttribute('name')] = $filterNode->nodeValue; } return $filters; }
php
private function parseFilters(\DOMXPath $xpath, \DOMNode $requestRootNode) { $filters = []; foreach ($xpath->query(self::FILTERS_PATH, $requestRootNode) as $filterNode) { $filters[$filterNode->getAttribute('name')] = $filterNode->nodeValue; } return $filters; }
[ "private", "function", "parseFilters", "(", "\\", "DOMXPath", "$", "xpath", ",", "\\", "DOMNode", "$", "requestRootNode", ")", "{", "$", "filters", "=", "[", "]", ";", "foreach", "(", "$", "xpath", "->", "query", "(", "self", "::", "FILTERS_PATH", ",", ...
Parse filters from request node configuration. @param \DOMXPath $xpath XPath access to the document parsed. @param \DOMNode $requestRootNode Request node to be parsed. @return array
[ "Parse", "filters", "from", "request", "node", "configuration", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php#L123-L132
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php
Converter.parseAggregations
private function parseAggregations(\DOMXPath $xpath, \DOMNode $rootNode) { $aggs = []; foreach ($xpath->query(self::AGGREGATIONS_PATH, $rootNode) as $aggNode) { $bucketName = $aggNode->getAttribute('name'); $bucketConfig = []; foreach ($aggNode->attributes as ...
php
private function parseAggregations(\DOMXPath $xpath, \DOMNode $rootNode) { $aggs = []; foreach ($xpath->query(self::AGGREGATIONS_PATH, $rootNode) as $aggNode) { $bucketName = $aggNode->getAttribute('name'); $bucketConfig = []; foreach ($aggNode->attributes as ...
[ "private", "function", "parseAggregations", "(", "\\", "DOMXPath", "$", "xpath", ",", "\\", "DOMNode", "$", "rootNode", ")", "{", "$", "aggs", "=", "[", "]", ";", "foreach", "(", "$", "xpath", "->", "query", "(", "self", "::", "AGGREGATIONS_PATH", ",", ...
Parse aggregations from request node configuration. @param \DOMXPath $xpath XPath access to the document parsed. @param \DOMNode $rootNode Request node to be parsed. @return array
[ "Parse", "aggregations", "from", "request", "node", "configuration", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php#L142-L164
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php
Converter.parseAggregationsProviders
private function parseAggregationsProviders(\DOMXPath $xpath, \DOMNode $rootNode) { $providers = []; foreach ($xpath->query(self::AGGREGATIONS_PROVIDERS_PATH, $rootNode) as $providerNode) { $providers[$providerNode->getAttribute('name')] = $providerNode->nodeValue; } re...
php
private function parseAggregationsProviders(\DOMXPath $xpath, \DOMNode $rootNode) { $providers = []; foreach ($xpath->query(self::AGGREGATIONS_PROVIDERS_PATH, $rootNode) as $providerNode) { $providers[$providerNode->getAttribute('name')] = $providerNode->nodeValue; } re...
[ "private", "function", "parseAggregationsProviders", "(", "\\", "DOMXPath", "$", "xpath", ",", "\\", "DOMNode", "$", "rootNode", ")", "{", "$", "providers", "=", "[", "]", ";", "foreach", "(", "$", "xpath", "->", "query", "(", "self", "::", "AGGREGATIONS_P...
Parse aggregations providers from request node configuration. @param \DOMXPath $xpath XPath access to the document parsed. @param \DOMNode $rootNode Request node to be parsed. @return array
[ "Parse", "aggregations", "providers", "from", "request", "node", "configuration", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php#L174-L183
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php
Converter.parseAggregationFilters
private function parseAggregationFilters(\DOMXPath $xpath, \DOMNode $rootNode) { $filters = []; foreach ($xpath->query(self::AGGREGATION_FILTERS_PATH, $rootNode) as $filterNode) { $filters[$filterNode->getAttribute('name')] = $filterNode->nodeValue; } return $filters; ...
php
private function parseAggregationFilters(\DOMXPath $xpath, \DOMNode $rootNode) { $filters = []; foreach ($xpath->query(self::AGGREGATION_FILTERS_PATH, $rootNode) as $filterNode) { $filters[$filterNode->getAttribute('name')] = $filterNode->nodeValue; } return $filters; ...
[ "private", "function", "parseAggregationFilters", "(", "\\", "DOMXPath", "$", "xpath", ",", "\\", "DOMNode", "$", "rootNode", ")", "{", "$", "filters", "=", "[", "]", ";", "foreach", "(", "$", "xpath", "->", "query", "(", "self", "::", "AGGREGATION_FILTERS...
Parse filters from a bucket. @param \DOMXPath $xpath XPath access to the document parsed. @param \DOMNode $rootNode Aggregation node to be parsed. @return null|string
[ "Parse", "filters", "from", "a", "bucket", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php#L193-L202
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php
Converter.parseMetrics
private function parseMetrics(\DOMXPath $xpath, \DOMNode $rootNode) { $metrics = []; foreach ($xpath->query(self::METRICS_PATH, $rootNode) as $metricNode) { $metric = []; foreach ($metricNode->attributes as $attribute) { $metric[$attribute->name] = $attribute...
php
private function parseMetrics(\DOMXPath $xpath, \DOMNode $rootNode) { $metrics = []; foreach ($xpath->query(self::METRICS_PATH, $rootNode) as $metricNode) { $metric = []; foreach ($metricNode->attributes as $attribute) { $metric[$attribute->name] = $attribute...
[ "private", "function", "parseMetrics", "(", "\\", "DOMXPath", "$", "xpath", ",", "\\", "DOMNode", "$", "rootNode", ")", "{", "$", "metrics", "=", "[", "]", ";", "foreach", "(", "$", "xpath", "->", "query", "(", "self", "::", "METRICS_PATH", ",", "$", ...
Parse metrics from a bucket. @param \DOMXPath $xpath XPath access to the document parsed. @param \DOMNode $rootNode Aggregation node to be parsed. @return array
[ "Parse", "metrics", "from", "a", "bucket", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php#L212-L225
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php
Converter.parsePipelines
private function parsePipelines(\DOMXPath $xpath, \DOMNode $rootNode) { $pipelines = []; foreach ($xpath->query(self::PIPELINES_PATH, $rootNode) as $pipelineNode) { $pipeline = []; foreach ($pipelineNode->attributes as $attribute) { $pipeline[$attribute->name...
php
private function parsePipelines(\DOMXPath $xpath, \DOMNode $rootNode) { $pipelines = []; foreach ($xpath->query(self::PIPELINES_PATH, $rootNode) as $pipelineNode) { $pipeline = []; foreach ($pipelineNode->attributes as $attribute) { $pipeline[$attribute->name...
[ "private", "function", "parsePipelines", "(", "\\", "DOMXPath", "$", "xpath", ",", "\\", "DOMNode", "$", "rootNode", ")", "{", "$", "pipelines", "=", "[", "]", ";", "foreach", "(", "$", "xpath", "->", "query", "(", "self", "::", "PIPELINES_PATH", ",", ...
Parse pipelines from a bucket. @param \DOMXPath $xpath XPath access to the document parsed. @param \DOMNode $rootNode Aggregation node to be parsed for pipeline aggregations. @return array
[ "Parse", "pipelines", "from", "a", "bucket", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php#L235-L249
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php
Converter.parsePipelineBucketsPath
private function parsePipelineBucketsPath(\DOMXPath $xpath, \DOMNode $pipelineNode) { $bucketsPath = null; foreach ($xpath->query(self::PIPELINE_COMPLEX_BUCKETS_PATH, $pipelineNode) as $bucketsPathMappingNode) { $paramName = $bucketsPathMappingNode->getAttribute('paramName'); ...
php
private function parsePipelineBucketsPath(\DOMXPath $xpath, \DOMNode $pipelineNode) { $bucketsPath = null; foreach ($xpath->query(self::PIPELINE_COMPLEX_BUCKETS_PATH, $pipelineNode) as $bucketsPathMappingNode) { $paramName = $bucketsPathMappingNode->getAttribute('paramName'); ...
[ "private", "function", "parsePipelineBucketsPath", "(", "\\", "DOMXPath", "$", "xpath", ",", "\\", "DOMNode", "$", "pipelineNode", ")", "{", "$", "bucketsPath", "=", "null", ";", "foreach", "(", "$", "xpath", "->", "query", "(", "self", "::", "PIPELINE_COMPL...
Parse the buckets path of a pipeline aggregation. @param \DOMXPath $xpath XPath access to the document parsed. @param \DOMNode $pipelineNode Pipeline aggregation node to be parsed for buckets path. @return null|array|string
[ "Parse", "the", "buckets", "path", "of", "a", "pipeline", "aggregation", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/BaseConfig/Converter.php#L259-L279
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/InventoryData.php
InventoryData.loadInventoryData
public function loadInventoryData($storeId, $productIds) { $websiteId = $this->getWebsiteId($storeId); $stockId = $this->getStockId($websiteId); $tableName = $this->stockIndexTableProvider->execute($stockId); $select = $this->getConnection()->select() ->from(['product'...
php
public function loadInventoryData($storeId, $productIds) { $websiteId = $this->getWebsiteId($storeId); $stockId = $this->getStockId($websiteId); $tableName = $this->stockIndexTableProvider->execute($stockId); $select = $this->getConnection()->select() ->from(['product'...
[ "public", "function", "loadInventoryData", "(", "$", "storeId", ",", "$", "productIds", ")", "{", "$", "websiteId", "=", "$", "this", "->", "getWebsiteId", "(", "$", "storeId", ")", ";", "$", "stockId", "=", "$", "this", "->", "getStockId", "(", "$", "...
Load inventory data for a list of product ids and a given store. Expected rows structure : ['product_id', 'stock_status', 'qty']. @param integer $storeId Store id. @param array $productIds Product ids list. @return array
[ "Load", "inventory", "data", "for", "a", "list", "of", "product", "ids", "and", "a", "given", "store", ".", "Expected", "rows", "structure", ":", "[", "product_id", "stock_status", "qty", "]", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/InventoryData.php#L81-L102
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/InventoryData.php
InventoryData.getStockId
private function getStockId($websiteId) { if (!isset($this->stockIdByWebsite[$websiteId])) { $websiteCode = $this->storeManager->getWebsite($websiteId)->getCode(); $stock = $this->stockResolver->execute(SalesChannelInterface::TYPE_WEBSITE, $websiteCode); $stockId = (int) ...
php
private function getStockId($websiteId) { if (!isset($this->stockIdByWebsite[$websiteId])) { $websiteCode = $this->storeManager->getWebsite($websiteId)->getCode(); $stock = $this->stockResolver->execute(SalesChannelInterface::TYPE_WEBSITE, $websiteCode); $stockId = (int) ...
[ "private", "function", "getStockId", "(", "$", "websiteId", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "stockIdByWebsite", "[", "$", "websiteId", "]", ")", ")", "{", "$", "websiteCode", "=", "$", "this", "->", "storeManager", "->", "get...
Retrieve stock_id by website @param int $websiteId The website Id @return int
[ "Retrieve", "stock_id", "by", "website" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/InventoryData.php#L111-L121
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Plugin/QueryRewrite.php
QueryRewrite.aroundCreateQuery
public function aroundCreateQuery( QueryBuilder $subject, \Closure $proceed, ContainerConfigurationInterface $containerConfiguration, $queryText, array $filters, $spellingType ) { $query = $proceed($containerConfiguration, $queryText, $filters, $spellingType);...
php
public function aroundCreateQuery( QueryBuilder $subject, \Closure $proceed, ContainerConfigurationInterface $containerConfiguration, $queryText, array $filters, $spellingType ) { $query = $proceed($containerConfiguration, $queryText, $filters, $spellingType);...
[ "public", "function", "aroundCreateQuery", "(", "QueryBuilder", "$", "subject", ",", "\\", "Closure", "$", "proceed", ",", "ContainerConfigurationInterface", "$", "containerConfiguration", ",", "$", "queryText", ",", "array", "$", "filters", ",", "$", "spellingType"...
Rewrite the query. @SuppressWarnings(PHPMD.UnusedFormalParameter) @param QueryBuilder $subject Original query builder. @param \Closure $proceed Original create func. @param ContainerConfigurationInterface $containerConfiguration Search request co...
[ "Rewrite", "the", "query", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Plugin/QueryRewrite.php#L59-L70
Smile-SA/elasticsuite
src/module-elasticsuite-swatches/Plugin/Search/Request/Product/Attribute/AggregationResolver.php
AggregationResolver.afterGetAggregationData
public function afterGetAggregationData( \Smile\ElasticsuiteCatalog\Search\Request\Product\Attribute\AggregationResolver $subject, $result, $attribute ) { if ($this->swatchHelper->isSwatchAttribute($attribute)) { $result['size'] = 0; } return $result; ...
php
public function afterGetAggregationData( \Smile\ElasticsuiteCatalog\Search\Request\Product\Attribute\AggregationResolver $subject, $result, $attribute ) { if ($this->swatchHelper->isSwatchAttribute($attribute)) { $result['size'] = 0; } return $result; ...
[ "public", "function", "afterGetAggregationData", "(", "\\", "Smile", "\\", "ElasticsuiteCatalog", "\\", "Search", "\\", "Request", "\\", "Product", "\\", "Attribute", "\\", "AggregationResolver", "$", "subject", ",", "$", "result", ",", "$", "attribute", ")", "{...
Set default facet size to 0 for swatches attributes before adding it as aggregation. @SuppressWarnings(PHPMD.UnusedFormalParameter) @param \Smile\ElasticsuiteCatalog\Search\Request\Product\Attribute\AggregationResolver $subject Aggregation Resolver @param array ...
[ "Set", "default", "facet", "size", "to", "0", "for", "swatches", "attributes", "before", "adding", "it", "as", "aggregation", ".", "@SuppressWarnings", "(", "PHPMD", ".", "UnusedFormalParameter", ")" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-swatches/Plugin/Search/Request/Product/Attribute/AggregationResolver.php#L50-L60
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Layer/Filter/Boolean.php
Boolean.apply
public function apply(\Magento\Framework\App\RequestInterface $request) { $attributeValue = (bool) $request->getParam($this->_requestVar); if (!empty($attributeValue)) { if (!is_array($attributeValue)) { $attributeValue = [$attributeValue]; } $th...
php
public function apply(\Magento\Framework\App\RequestInterface $request) { $attributeValue = (bool) $request->getParam($this->_requestVar); if (!empty($attributeValue)) { if (!is_array($attributeValue)) { $attributeValue = [$attributeValue]; } $th...
[ "public", "function", "apply", "(", "\\", "Magento", "\\", "Framework", "\\", "App", "\\", "RequestInterface", "$", "request", ")", "{", "$", "attributeValue", "=", "(", "bool", ")", "$", "request", "->", "getParam", "(", "$", "this", "->", "_requestVar", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Boolean.php#L28-L57
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Layer/Filter/Boolean.php
Boolean._initItems
protected function _initItems() { parent::_initItems(); foreach ($this->_items as $item) { $applyValue = $item->getLabel(); if ($item->getValue() == \Magento\Eav\Model\Entity\Attribute\Source\Boolean::VALUE_YES) { if (is_numeric($item->getLabel())) { ...
php
protected function _initItems() { parent::_initItems(); foreach ($this->_items as $item) { $applyValue = $item->getLabel(); if ($item->getValue() == \Magento\Eav\Model\Entity\Attribute\Source\Boolean::VALUE_YES) { if (is_numeric($item->getLabel())) { ...
[ "protected", "function", "_initItems", "(", ")", "{", "parent", "::", "_initItems", "(", ")", ";", "foreach", "(", "$", "this", "->", "_items", "as", "$", "item", ")", "{", "$", "applyValue", "=", "$", "item", "->", "getLabel", "(", ")", ";", "if", ...
@SuppressWarnings(PHPMD.CamelCaseMethodName) @SuppressWarnings(PHPMD.ElseExpression) {@inheritDoc}
[ "@SuppressWarnings", "(", "PHPMD", ".", "CamelCaseMethodName", ")", "@SuppressWarnings", "(", "PHPMD", ".", "ElseExpression", ")" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Boolean.php#L85-L111
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/Aggregation/AggregationFactory.php
AggregationFactory.create
public function create($bucketType, $bucketParams) { if (!isset($this->factories[$bucketType])) { throw new \LogicException("No factory found for aggregation of type {$bucketType}"); } return $this->factories[$bucketType]->create($bucketParams); }
php
public function create($bucketType, $bucketParams) { if (!isset($this->factories[$bucketType])) { throw new \LogicException("No factory found for aggregation of type {$bucketType}"); } return $this->factories[$bucketType]->create($bucketParams); }
[ "public", "function", "create", "(", "$", "bucketType", ",", "$", "bucketParams", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "factories", "[", "$", "bucketType", "]", ")", ")", "{", "throw", "new", "\\", "LogicException", "(", "\"No fac...
Create a new bucket from it's type and params. @param string $bucketType Bucket type (must be a valid bucket type defined into the factories array). @param array $bucketParams Bucket constructor params. @return BucketInterface
[ "Create", "a", "new", "bucket", "from", "it", "s", "type", "and", "params", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Aggregation/AggregationFactory.php#L51-L58
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Controller/Adminhtml/Thesaurus/Delete.php
Delete.execute
public function execute() { /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); $identifier = $this->getRequest()->getParam('thesaurus_id', false); $model = $this->thesaurusFactory->create(); if ($...
php
public function execute() { /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); $identifier = $this->getRequest()->getParam('thesaurus_id', false); $model = $this->thesaurusFactory->create(); if ($...
[ "public", "function", "execute", "(", ")", "{", "/** @var \\Magento\\Backend\\Model\\View\\Result\\Redirect $resultRedirect */", "$", "resultRedirect", "=", "$", "this", "->", "resultRedirectFactory", "->", "create", "(", ")", ";", "$", "identifier", "=", "$", "this", ...
Delete a Thesaurus @return \Magento\Backend\Model\View\Result\Redirect
[ "Delete", "a", "Thesaurus" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Controller/Adminhtml/Thesaurus/Delete.php#L32-L58
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php
AttributeData.addData
public function addData($storeId, array $indexData) { $productIds = array_keys($indexData); $indexData = $this->addAttributeData($storeId, $productIds, $indexData); $relationsByChildId = $this->resourceModel->loadChildrens($productIds, $storeId); if (!empty($relationsByChildId...
php
public function addData($storeId, array $indexData) { $productIds = array_keys($indexData); $indexData = $this->addAttributeData($storeId, $productIds, $indexData); $relationsByChildId = $this->resourceModel->loadChildrens($productIds, $storeId); if (!empty($relationsByChildId...
[ "public", "function", "addData", "(", "$", "storeId", ",", "array", "$", "indexData", ")", "{", "$", "productIds", "=", "array_keys", "(", "$", "indexData", ")", ";", "$", "indexData", "=", "$", "this", "->", "addAttributeData", "(", "$", "storeId", ",",...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php#L39-L73
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php
AttributeData.addAttributeData
private function addAttributeData($storeId, $productIds, $indexData = []) { foreach ($this->attributeIdsByTable as $backendTable => $attributeIds) { $attributesData = $this->loadAttributesRawData($storeId, $productIds, $backendTable, $attributeIds); foreach ($attributesData as $row) ...
php
private function addAttributeData($storeId, $productIds, $indexData = []) { foreach ($this->attributeIdsByTable as $backendTable => $attributeIds) { $attributesData = $this->loadAttributesRawData($storeId, $productIds, $backendTable, $attributeIds); foreach ($attributesData as $row) ...
[ "private", "function", "addAttributeData", "(", "$", "storeId", ",", "$", "productIds", ",", "$", "indexData", "=", "[", "]", ")", "{", "foreach", "(", "$", "this", "->", "attributeIdsByTable", "as", "$", "backendTable", "=>", "$", "attributeIds", ")", "{"...
Append attribute data to the index. @param int $storeId Indexed store id. @param array $productIds Indexed product ids. @param array $indexData Original indexed data. @return array
[ "Append", "attribute", "data", "to", "the", "index", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php#L84-L103
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php
AttributeData.addChildData
private function addChildData(&$parentData, $childAttributes) { $authorizedChildAttributes = $parentData['children_attributes']; $addedChildAttributesData = array_filter( $childAttributes, function ($attributeCode) use ($authorizedChildAttributes) { return in...
php
private function addChildData(&$parentData, $childAttributes) { $authorizedChildAttributes = $parentData['children_attributes']; $addedChildAttributesData = array_filter( $childAttributes, function ($attributeCode) use ($authorizedChildAttributes) { return in...
[ "private", "function", "addChildData", "(", "&", "$", "parentData", ",", "$", "childAttributes", ")", "{", "$", "authorizedChildAttributes", "=", "$", "parentData", "[", "'children_attributes'", "]", ";", "$", "addedChildAttributesData", "=", "array_filter", "(", ...
Append data of child products to the parent. @param array $parentData Parent product data. @param array $childAttributes Child product attributes data. @return void
[ "Append", "data", "of", "child", "products", "to", "the", "parent", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php#L113-L131
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php
AttributeData.addRelationData
private function addRelationData(&$parentData, $childAttributes, $relation) { $childAttributeCodes = array_keys($childAttributes); $parentAttributeCodes = array_keys($parentData); if (!isset($parentData['children_attributes'])) { $parentData['children_attributes'] = ['indexed_a...
php
private function addRelationData(&$parentData, $childAttributes, $relation) { $childAttributeCodes = array_keys($childAttributes); $parentAttributeCodes = array_keys($parentData); if (!isset($parentData['children_attributes'])) { $parentData['children_attributes'] = ['indexed_a...
[ "private", "function", "addRelationData", "(", "&", "$", "parentData", ",", "$", "childAttributes", ",", "$", "relation", ")", "{", "$", "childAttributeCodes", "=", "array_keys", "(", "$", "childAttributes", ")", ";", "$", "parentAttributeCodes", "=", "array_key...
Append relation information to the index for composite products. @param array $parentData Parent product data. @param array $childAttributes Child product attributes data. @param array $relation Relation data between the child and the parent. @return void
[ "Append", "relation", "information", "to", "the", "index", "for", "composite", "products", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php#L142-L183
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php
AttributeData.filterCompositeProducts
private function filterCompositeProducts($indexData) { $compositeProductTypes = $this->resourceModel->getCompositeTypes(); foreach ($indexData as $productId => $productData) { $isComposite = in_array($productData['type_id'], $compositeProductTypes); $hasChildren = isset($pro...
php
private function filterCompositeProducts($indexData) { $compositeProductTypes = $this->resourceModel->getCompositeTypes(); foreach ($indexData as $productId => $productData) { $isComposite = in_array($productData['type_id'], $compositeProductTypes); $hasChildren = isset($pro...
[ "private", "function", "filterCompositeProducts", "(", "$", "indexData", ")", "{", "$", "compositeProductTypes", "=", "$", "this", "->", "resourceModel", "->", "getCompositeTypes", "(", ")", ";", "foreach", "(", "$", "indexData", "as", "$", "productId", "=>", ...
Filter out composite product when no enabled children are attached. @param array $indexData Indexed data. @return array
[ "Filter", "out", "composite", "product", "when", "no", "enabled", "children", "are", "attached", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php#L192-L205
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php
AttributeData.addChildSku
private function addChildSku(&$parentData, $relation) { if (isset($parentData['sku']) && !is_array($parentData['sku'])) { $parentData['sku'] = [$parentData['sku']]; } $parentData['sku'][] = $relation['sku']; $parentData['sku'] = array_unique($parentData['sku']); }
php
private function addChildSku(&$parentData, $relation) { if (isset($parentData['sku']) && !is_array($parentData['sku'])) { $parentData['sku'] = [$parentData['sku']]; } $parentData['sku'][] = $relation['sku']; $parentData['sku'] = array_unique($parentData['sku']); }
[ "private", "function", "addChildSku", "(", "&", "$", "parentData", ",", "$", "relation", ")", "{", "if", "(", "isset", "(", "$", "parentData", "[", "'sku'", "]", ")", "&&", "!", "is_array", "(", "$", "parentData", "[", "'sku'", "]", ")", ")", "{", ...
Append SKU of children product to the parent product index data. @param array $parentData Parent product data. @param array $relation Relation data between the child and the parent.
[ "Append", "SKU", "of", "children", "product", "to", "the", "parent", "product", "index", "data", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php#L213-L221
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php
AttributeData.addIndexedAttribute
private function addIndexedAttribute(&$productIndexData, $attribute) { if (!isset($productIndexData['indexed_attributes'])) { $productIndexData['indexed_attributes'] = []; } // Data can be missing for this attribute (Eg : due to null value being escaped). if (isset($prod...
php
private function addIndexedAttribute(&$productIndexData, $attribute) { if (!isset($productIndexData['indexed_attributes'])) { $productIndexData['indexed_attributes'] = []; } // Data can be missing for this attribute (Eg : due to null value being escaped). if (isset($prod...
[ "private", "function", "addIndexedAttribute", "(", "&", "$", "productIndexData", ",", "$", "attribute", ")", "{", "if", "(", "!", "isset", "(", "$", "productIndexData", "[", "'indexed_attributes'", "]", ")", ")", "{", "$", "productIndexData", "[", "'indexed_at...
Append an indexed attributes to indexed data of a given product. @param array $productIndexData Product Index data @param \Magento\Eav\Model\Entity\Attribute\AttributeInterface $attribute The attribute
[ "Append", "an", "indexed", "attributes", "to", "indexed", "data", "of", "a", "given", "product", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/AttributeData.php#L229-L239
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Model/Indexer/Thesaurus.php
Thesaurus.executeFull
public function executeFull() { $storeIds = array_keys($this->storeManager->getStores()); foreach ($storeIds as $storeId) { $synonyms = $this->resourceModel->getSynonyms($storeId); $expansions = $this->resourceModel->getExpansions($storeId); $this->indexHandler-...
php
public function executeFull() { $storeIds = array_keys($this->storeManager->getStores()); foreach ($storeIds as $storeId) { $synonyms = $this->resourceModel->getSynonyms($storeId); $expansions = $this->resourceModel->getExpansions($storeId); $this->indexHandler-...
[ "public", "function", "executeFull", "(", ")", "{", "$", "storeIds", "=", "array_keys", "(", "$", "this", "->", "storeManager", "->", "getStores", "(", ")", ")", ";", "foreach", "(", "$", "storeIds", "as", "$", "storeId", ")", "{", "$", "synonyms", "="...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/Indexer/Thesaurus.php#L69-L77
Smile-SA/elasticsuite
src/module-elasticsuite-core/Index/Index.php
Index.getType
public function getType($typeName) { if (!isset($this->types[$typeName])) { throw new \InvalidArgumentException("Type $typeName does not exists in the index."); } return $this->types[$typeName]; }
php
public function getType($typeName) { if (!isset($this->types[$typeName])) { throw new \InvalidArgumentException("Type $typeName does not exists in the index."); } return $this->types[$typeName]; }
[ "public", "function", "getType", "(", "$", "typeName", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "types", "[", "$", "typeName", "]", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "\"Type $typeName does not exists in t...
@throws \InvalidArgumentException When the type does not exists. @deprecated {@inheritdoc}
[ "@throws", "\\", "InvalidArgumentException", "When", "the", "type", "does", "not", "exists", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Index.php#L133-L140
Smile-SA/elasticsuite
src/module-elasticsuite-core/Index/Index.php
Index.prepareTypes
private function prepareTypes($types) { $preparedTypes = []; foreach ($types as $type) { $preparedTypes[$type->getName()] = $type; } return $preparedTypes; }
php
private function prepareTypes($types) { $preparedTypes = []; foreach ($types as $type) { $preparedTypes[$type->getName()] = $type; } return $preparedTypes; }
[ "private", "function", "prepareTypes", "(", "$", "types", ")", "{", "$", "preparedTypes", "=", "[", "]", ";", "foreach", "(", "$", "types", "as", "$", "type", ")", "{", "$", "preparedTypes", "[", "$", "type", "->", "getName", "(", ")", "]", "=", "$...
Prepare the types added to the index (rekey the array). @deprecated @param TypeInterface[] $types Installed types. @return TypeInterface[]
[ "Prepare", "the", "types", "added", "to", "the", "index", "(", "rekey", "the", "array", ")", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Index.php#L183-L192
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Attribute.php
Attribute.getUrl
public function getUrl() { $qsParams = $this->getApplyQueryStringParams(); $url = $this->rewriteBaseUrl($qsParams); if ($url === null) { $url = $this->_url->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true, '_query' => $qsParams]); } return $url; ...
php
public function getUrl() { $qsParams = $this->getApplyQueryStringParams(); $url = $this->rewriteBaseUrl($qsParams); if ($url === null) { $url = $this->_url->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true, '_query' => $qsParams]); } return $url; ...
[ "public", "function", "getUrl", "(", ")", "{", "$", "qsParams", "=", "$", "this", "->", "getApplyQueryStringParams", "(", ")", ";", "$", "url", "=", "$", "this", "->", "rewriteBaseUrl", "(", "$", "qsParams", ")", ";", "if", "(", "$", "url", "===", "n...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Attribute.php#L29-L40
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Attribute.php
Attribute.getRemoveUrl
public function getRemoveUrl() { $query = [$this->getFilter()->getRequestVar() => $this->getFilter()->getResetValue()]; if (is_array($this->getApplyValue())) { $resetValue = array_diff($this->getApplyValue(), [$this->getLabel()]); if (count($resetValue) < 2) { ...
php
public function getRemoveUrl() { $query = [$this->getFilter()->getRequestVar() => $this->getFilter()->getResetValue()]; if (is_array($this->getApplyValue())) { $resetValue = array_diff($this->getApplyValue(), [$this->getLabel()]); if (count($resetValue) < 2) { ...
[ "public", "function", "getRemoveUrl", "(", ")", "{", "$", "query", "=", "[", "$", "this", "->", "getFilter", "(", ")", "->", "getRequestVar", "(", ")", "=>", "$", "this", "->", "getFilter", "(", ")", "->", "getResetValue", "(", ")", "]", ";", "if", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Attribute.php#L45-L66
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Attribute.php
Attribute.toArray
public function toArray(array $keys = []) { $data = parent::toArray($keys); if (in_array('url', $keys) || empty($keys)) { $data['url'] = $this->getUrl(); } if (in_array('is_selected', $keys) || empty($keys)) { $data['is_selected'] = (bool) $this->getIsSelect...
php
public function toArray(array $keys = []) { $data = parent::toArray($keys); if (in_array('url', $keys) || empty($keys)) { $data['url'] = $this->getUrl(); } if (in_array('is_selected', $keys) || empty($keys)) { $data['is_selected'] = (bool) $this->getIsSelect...
[ "public", "function", "toArray", "(", "array", "$", "keys", "=", "[", "]", ")", "{", "$", "data", "=", "parent", "::", "toArray", "(", "$", "keys", ")", ";", "if", "(", "in_array", "(", "'url'", ",", "$", "keys", ")", "||", "empty", "(", "$", "...
Append url and is_selected computed fields to the result array. {@inheritDoc}
[ "Append", "url", "and", "is_selected", "computed", "fields", "to", "the", "result", "array", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Attribute.php#L73-L86
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Attribute.php
Attribute.getApplyValue
private function getApplyValue() { $value = $this->getValue(); if (is_array($this->getApplyFilterValue())) { $value = $this->getApplyFilterValue(); } if (is_array($value) && count($value) == 1) { $value = current($value); } return $value; ...
php
private function getApplyValue() { $value = $this->getValue(); if (is_array($this->getApplyFilterValue())) { $value = $this->getApplyFilterValue(); } if (is_array($value) && count($value) == 1) { $value = current($value); } return $value; ...
[ "private", "function", "getApplyValue", "(", ")", "{", "$", "value", "=", "$", "this", "->", "getValue", "(", ")", ";", "if", "(", "is_array", "(", "$", "this", "->", "getApplyFilterValue", "(", ")", ")", ")", "{", "$", "value", "=", "$", "this", "...
Return the value used to apply the filter. @return string|array
[ "Return", "the", "value", "used", "to", "apply", "the", "filter", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Attribute.php#L93-L106
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Attribute.php
Attribute.getApplyQueryStringParams
private function getApplyQueryStringParams() { $qsParams = [ $this->getFilter()->getRequestVar() => $this->getApplyValue(), $this->_htmlPagerBlock->getPageVarName() => null, ]; return $qsParams; }
php
private function getApplyQueryStringParams() { $qsParams = [ $this->getFilter()->getRequestVar() => $this->getApplyValue(), $this->_htmlPagerBlock->getPageVarName() => null, ]; return $qsParams; }
[ "private", "function", "getApplyQueryStringParams", "(", ")", "{", "$", "qsParams", "=", "[", "$", "this", "->", "getFilter", "(", ")", "->", "getRequestVar", "(", ")", "=>", "$", "this", "->", "getApplyValue", "(", ")", ",", "$", "this", "->", "_htmlPag...
Get query string params used to apply the filter. @return array
[ "Get", "query", "string", "params", "used", "to", "apply", "the", "filter", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Attribute.php#L112-L120
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Attribute.php
Attribute.rewriteBaseUrl
private function rewriteBaseUrl($qsParams) { $url = null; if ($this->getBaseUrl()) { $baseUrlParts = explode('?', $this->getBaseUrl()); $qsParser = new \Zend\Stdlib\Parameters(); $qsParser->fromArray($qsParams); if (count($baseUrlParts) > 1) { ...
php
private function rewriteBaseUrl($qsParams) { $url = null; if ($this->getBaseUrl()) { $baseUrlParts = explode('?', $this->getBaseUrl()); $qsParser = new \Zend\Stdlib\Parameters(); $qsParser->fromArray($qsParams); if (count($baseUrlParts) > 1) { ...
[ "private", "function", "rewriteBaseUrl", "(", "$", "qsParams", ")", "{", "$", "url", "=", "null", ";", "if", "(", "$", "this", "->", "getBaseUrl", "(", ")", ")", "{", "$", "baseUrlParts", "=", "explode", "(", "'?'", ",", "$", "this", "->", "getBaseUr...
Create the URL used to apply the filter from a existing URL. @param array $qsParams Query string params. @return NULL|string
[ "Create", "the", "URL", "used", "to", "apply", "the", "filter", "from", "a", "existing", "URL", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Attribute.php#L129-L151
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/Query/QueryFactory.php
QueryFactory.create
public function create($queryType, $queryParams = []) { if (!isset($this->factories[$queryType])) { throw new \LogicException("No factory found for query of type {$queryType}"); } return $this->factories[$queryType]->create($queryParams); }
php
public function create($queryType, $queryParams = []) { if (!isset($this->factories[$queryType])) { throw new \LogicException("No factory found for query of type {$queryType}"); } return $this->factories[$queryType]->create($queryParams); }
[ "public", "function", "create", "(", "$", "queryType", ",", "$", "queryParams", "=", "[", "]", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "factories", "[", "$", "queryType", "]", ")", ")", "{", "throw", "new", "\\", "LogicException", ...
Create a query from it's type and params. @param string $queryType Query type (must be a valid query type defined into the factories array). @param array $queryParams Query constructor params. @return QueryInterface
[ "Create", "a", "query", "from", "it", "s", "type", "and", "params", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Query/QueryFactory.php#L50-L57
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Search/Request/Container/Filter/SearchBlacklist.php
SearchBlacklist.getFilterQuery
public function getFilterQuery() { $query = null; if ($this->getSearchQueryId() !== null) { $query = $this->getIsNotBlacklistedQuery((int) $this->getSearchQueryId()); } return $query; }
php
public function getFilterQuery() { $query = null; if ($this->getSearchQueryId() !== null) { $query = $this->getIsNotBlacklistedQuery((int) $this->getSearchQueryId()); } return $query; }
[ "public", "function", "getFilterQuery", "(", ")", "{", "$", "query", "=", "null", ";", "if", "(", "$", "this", "->", "getSearchQueryId", "(", ")", "!==", "null", ")", "{", "$", "query", "=", "$", "this", "->", "getIsNotBlacklistedQuery", "(", "(", "int...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Search/Request/Container/Filter/SearchBlacklist.php#L55-L64
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Search/Request/Container/Filter/SearchBlacklist.php
SearchBlacklist.getSearchQueryId
private function getSearchQueryId() { $queryId = null; if ($this->searchContext->getCurrentSearchQuery()) { $queryId = $this->searchContext->getCurrentSearchQuery()->getId(); } return $queryId; }
php
private function getSearchQueryId() { $queryId = null; if ($this->searchContext->getCurrentSearchQuery()) { $queryId = $this->searchContext->getCurrentSearchQuery()->getId(); } return $queryId; }
[ "private", "function", "getSearchQueryId", "(", ")", "{", "$", "queryId", "=", "null", ";", "if", "(", "$", "this", "->", "searchContext", "->", "getCurrentSearchQuery", "(", ")", ")", "{", "$", "queryId", "=", "$", "this", "->", "searchContext", "->", "...
Returns search query id. @return NULL|integer
[ "Returns", "search", "query", "id", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Search/Request/Container/Filter/SearchBlacklist.php#L71-L80
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Setup/InstallData.php
InstallData.install
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); $this->catalogSetup->addCategoryNameSearchAttribute($eavSetup); $this->catalogSetup->updateCategoryIsAnc...
php
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); $this->catalogSetup->addCategoryNameSearchAttribute($eavSetup); $this->catalogSetup->updateCategoryIsAnc...
[ "public", "function", "install", "(", "ModuleDataSetupInterface", "$", "setup", ",", "ModuleContextInterface", "$", "context", ")", "{", "$", "setup", "->", "startSetup", "(", ")", ";", "$", "eavSetup", "=", "$", "this", "->", "eavSetupFactory", "->", "create"...
@SuppressWarnings(PHPMD.UnusedFormalParameter) Installs Data for the module : - Create attribute on category to enable/disable name indexation for search - Update is anchor attribute (hidden frontend input, null source model, enabled by default). @param ModuleDataSetupInterface $setup The setup interface @param Mod...
[ "@SuppressWarnings", "(", "PHPMD", ".", "UnusedFormalParameter", ")" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Setup/InstallData.php#L83-L97
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/Not.php
Not.buildQuery
public function buildQuery(QueryInterface $query) { if ($query->getType() !== QueryInterface::TYPE_NOT) { throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}"); } $subQuery = $this->parentBuilder->buildQuery($query->getQuery()); ...
php
public function buildQuery(QueryInterface $query) { if ($query->getType() !== QueryInterface::TYPE_NOT) { throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}"); } $subQuery = $this->parentBuilder->buildQuery($query->getQuery()); ...
[ "public", "function", "buildQuery", "(", "QueryInterface", "$", "query", ")", "{", "if", "(", "$", "query", "->", "getType", "(", ")", "!==", "QueryInterface", "::", "TYPE_NOT", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "\"Query builder ...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/Not.php#L32-L46
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/Query/Fulltext/SearchableFieldFilter.php
SearchableFieldFilter.filterField
public function filterField(FieldInterface $field) { return $field->getType() == FieldInterface::FIELD_TYPE_TEXT && $field->isSearchable() && $field->isNested() === false; }
php
public function filterField(FieldInterface $field) { return $field->getType() == FieldInterface::FIELD_TYPE_TEXT && $field->isSearchable() && $field->isNested() === false; }
[ "public", "function", "filterField", "(", "FieldInterface", "$", "field", ")", "{", "return", "$", "field", "->", "getType", "(", ")", "==", "FieldInterface", "::", "FIELD_TYPE_TEXT", "&&", "$", "field", "->", "isSearchable", "(", ")", "&&", "$", "field", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Query/Fulltext/SearchableFieldFilter.php#L32-L35
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Helper/AbstractAttribute.php
AbstractAttribute.getMappingFieldOptions
public function getMappingFieldOptions(AttributeInterface $attribute) { $options = [ 'is_searchable' => $attribute->getIsSearchable(), 'is_filterable' => $attribute->getIsFilterable() || $attribute->getIsFilterableInSearch(), 'search_weight' => $attribut...
php
public function getMappingFieldOptions(AttributeInterface $attribute) { $options = [ 'is_searchable' => $attribute->getIsSearchable(), 'is_filterable' => $attribute->getIsFilterable() || $attribute->getIsFilterableInSearch(), 'search_weight' => $attribut...
[ "public", "function", "getMappingFieldOptions", "(", "AttributeInterface", "$", "attribute", ")", "{", "$", "options", "=", "[", "'is_searchable'", "=>", "$", "attribute", "->", "getIsSearchable", "(", ")", ",", "'is_filterable'", "=>", "$", "attribute", "->", "...
Parse attribute to get mapping field creation parameters. @param AttributeInterface $attribute Product attribute. @return array
[ "Parse", "attribute", "to", "get", "mapping", "field", "creation", "parameters", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Helper/AbstractAttribute.php#L86-L109
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Helper/AbstractAttribute.php
AbstractAttribute.getFieldType
public function getFieldType(AttributeInterface $attribute) { $type = FieldInterface::FIELD_TYPE_TEXT; if ($attribute->getSourceModel() == 'Magento\Eav\Model\Entity\Attribute\Source\Boolean') { $type = FieldInterface::FIELD_TYPE_BOOLEAN; } elseif ($attribute->getBackendType() ==...
php
public function getFieldType(AttributeInterface $attribute) { $type = FieldInterface::FIELD_TYPE_TEXT; if ($attribute->getSourceModel() == 'Magento\Eav\Model\Entity\Attribute\Source\Boolean') { $type = FieldInterface::FIELD_TYPE_BOOLEAN; } elseif ($attribute->getBackendType() ==...
[ "public", "function", "getFieldType", "(", "AttributeInterface", "$", "attribute", ")", "{", "$", "type", "=", "FieldInterface", "::", "FIELD_TYPE_TEXT", ";", "if", "(", "$", "attribute", "->", "getSourceModel", "(", ")", "==", "'Magento\\Eav\\Model\\Entity\\Attribu...
Get mapping field type for an attribute. @param AttributeInterface $attribute Product attribute. @return string
[ "Get", "mapping", "field", "type", "for", "an", "attribute", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Helper/AbstractAttribute.php#L118-L137
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Helper/AbstractAttribute.php
AbstractAttribute.prepareIndexValue
public function prepareIndexValue(AttributeInterface $attribute, $storeId, $value) { $attributeCode = $attribute->getAttributeCode(); $values = []; $mapperKey = 'simple_' . $attribute->getId(); if (!isset($this->attributeMappers[$mapperKey])) { $this->attributeMappers[$...
php
public function prepareIndexValue(AttributeInterface $attribute, $storeId, $value) { $attributeCode = $attribute->getAttributeCode(); $values = []; $mapperKey = 'simple_' . $attribute->getId(); if (!isset($this->attributeMappers[$mapperKey])) { $this->attributeMappers[$...
[ "public", "function", "prepareIndexValue", "(", "AttributeInterface", "$", "attribute", ",", "$", "storeId", ",", "$", "value", ")", "{", "$", "attributeCode", "=", "$", "attribute", "->", "getAttributeCode", "(", ")", ";", "$", "values", "=", "[", "]", ";...
Parse attribute raw value (as saved in the database) to prepare the indexed value. For attribute using options the option value is also added to the result which contains two keys : - one is "attribute_code" and contained the option id(s) - the other one is "option_text_attribute_code" and contained option value(s) All...
[ "Parse", "attribute", "raw", "value", "(", "as", "saved", "in", "the", "database", ")", "to", "prepare", "the", "indexed", "value", ".", "For", "attribute", "using", "options", "the", "option", "value", "is", "also", "added", "to", "the", "result", "which"...
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Helper/AbstractAttribute.php#L154-L190
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Helper/AbstractAttribute.php
AbstractAttribute.getIndexOptionsText
public function getIndexOptionsText(AttributeInterface $attribute, $storeId, array $optionIds) { $mapperKey = sprintf("options_%s_%s", $attribute->getId(), $storeId); if (!isset($this->attributeMappers[$mapperKey])) { $this->attributeMappers[$mapperKey] = function ($optionId) use ($attr...
php
public function getIndexOptionsText(AttributeInterface $attribute, $storeId, array $optionIds) { $mapperKey = sprintf("options_%s_%s", $attribute->getId(), $storeId); if (!isset($this->attributeMappers[$mapperKey])) { $this->attributeMappers[$mapperKey] = function ($optionId) use ($attr...
[ "public", "function", "getIndexOptionsText", "(", "AttributeInterface", "$", "attribute", ",", "$", "storeId", ",", "array", "$", "optionIds", ")", "{", "$", "mapperKey", "=", "sprintf", "(", "\"options_%s_%s\"", ",", "$", "attribute", "->", "getId", "(", ")",...
Transform an array of options ids into an arrays of option values for attribute that uses a source. Values are localized for a store id. @param AttributeInterface $attribute Product attribute. @param integer $storeId Store id @param array $optionIds Array of options ids. @return array
[ "Transform", "an", "array", "of", "options", "ids", "into", "an", "arrays", "of", "option", "values", "for", "attribute", "that", "uses", "a", "source", ".", "Values", "are", "localized", "for", "a", "store", "id", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Helper/AbstractAttribute.php#L202-L215
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Helper/AbstractAttribute.php
AbstractAttribute.getIndexOptionText
public function getIndexOptionText(AttributeInterface $attribute, $storeId, $optionId) { $attribute = $this->getAttributeByStore($attribute, $storeId); $attributeId = $attribute->getAttributeId(); if (!isset($this->attributeOptionTextCache[$storeId]) || !isset($this->attributeOptionTextCach...
php
public function getIndexOptionText(AttributeInterface $attribute, $storeId, $optionId) { $attribute = $this->getAttributeByStore($attribute, $storeId); $attributeId = $attribute->getAttributeId(); if (!isset($this->attributeOptionTextCache[$storeId]) || !isset($this->attributeOptionTextCach...
[ "public", "function", "getIndexOptionText", "(", "AttributeInterface", "$", "attribute", ",", "$", "storeId", ",", "$", "optionId", ")", "{", "$", "attribute", "=", "$", "this", "->", "getAttributeByStore", "(", "$", "attribute", ",", "$", "storeId", ")", ";...
Transform an options id into an array of option value for attribute that uses a source. Value islocalized for a store id. @param AttributeInterface $attribute Product attribute. @param integer $storeId Store id. @param string|integer $optionId Option id. @return string|boolean
[ "Transform", "an", "options", "id", "into", "an", "array", "of", "option", "value", "for", "attribute", "that", "uses", "a", "source", ".", "Value", "islocalized", "for", "a", "store", "id", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Helper/AbstractAttribute.php#L227-L245
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Helper/AbstractAttribute.php
AbstractAttribute.getFilterField
public function getFilterField(AttributeInterface $attribute) { $field = $attribute->getAttributeCode(); if ($attribute->usesSource()) { $field = $this->getOptionTextFieldName($field); } return $field; }
php
public function getFilterField(AttributeInterface $attribute) { $field = $attribute->getAttributeCode(); if ($attribute->usesSource()) { $field = $this->getOptionTextFieldName($field); } return $field; }
[ "public", "function", "getFilterField", "(", "AttributeInterface", "$", "attribute", ")", "{", "$", "field", "=", "$", "attribute", "->", "getAttributeCode", "(", ")", ";", "if", "(", "$", "attribute", "->", "usesSource", "(", ")", ")", "{", "$", "field", ...
Returns field use for filtering for an attribute. @param AttributeInterface $attribute Attribute. @return string
[ "Returns", "field", "use", "for", "filtering", "for", "an", "attribute", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Helper/AbstractAttribute.php#L254-L263
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Helper/AbstractAttribute.php
AbstractAttribute.prepareSimpleIndexAttributeValue
private function prepareSimpleIndexAttributeValue(AttributeInterface $attribute, $value) { if ($this->getFieldType($attribute) == FieldInterface::FIELD_TYPE_BOOLEAN) { $value = boolval($value); } elseif ($attribute->getBackendType() == 'decimal') { $value = floatval($value); ...
php
private function prepareSimpleIndexAttributeValue(AttributeInterface $attribute, $value) { if ($this->getFieldType($attribute) == FieldInterface::FIELD_TYPE_BOOLEAN) { $value = boolval($value); } elseif ($attribute->getBackendType() == 'decimal') { $value = floatval($value); ...
[ "private", "function", "prepareSimpleIndexAttributeValue", "(", "AttributeInterface", "$", "attribute", ",", "$", "value", ")", "{", "if", "(", "$", "this", "->", "getFieldType", "(", "$", "attribute", ")", "==", "FieldInterface", "::", "FIELD_TYPE_BOOLEAN", ")", ...
Ensure types of numerical values is correct before indexing. @param AttributeInterface $attribute Product attribute. @param mixed $value Raw value. @return mixed
[ "Ensure", "types", "of", "numerical", "values", "is", "correct", "before", "indexing", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Helper/AbstractAttribute.php#L273-L284
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Helper/AbstractAttribute.php
AbstractAttribute.getAttributeByStore
private function getAttributeByStore($attribute, $storeId) { $attributeId = $this->getAttributeId($attribute); if (!isset($this->storeAttributes[$storeId]) || !isset($this->storeAttributes[$storeId][$attributeId])) { /** * @var EavAttributeInterface */ ...
php
private function getAttributeByStore($attribute, $storeId) { $attributeId = $this->getAttributeId($attribute); if (!isset($this->storeAttributes[$storeId]) || !isset($this->storeAttributes[$storeId][$attributeId])) { /** * @var EavAttributeInterface */ ...
[ "private", "function", "getAttributeByStore", "(", "$", "attribute", ",", "$", "storeId", ")", "{", "$", "attributeId", "=", "$", "this", "->", "getAttributeId", "(", "$", "attribute", ")", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "storeAttr...
Load the localized version of an attribute. This code uses a local cache to ensure correct performance during indexing. @param AttributeInterface|int $attribute Product attribute. @param integer $storeId Store id. @return \Magento\Catalog\Api\Data\EavAttributeInterface
[ "Load", "the", "localized", "version", "of", "an", "attribute", ".", "This", "code", "uses", "a", "local", "cache", "to", "ensure", "correct", "performance", "during", "indexing", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Helper/AbstractAttribute.php#L295-L309
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Helper/AbstractAttribute.php
AbstractAttribute.getAttributeId
private function getAttributeId($attribute) { $attributeId = $attribute; if (is_object($attribute)) { $attributeId = $attribute->getAttributeId(); } return $attributeId; }
php
private function getAttributeId($attribute) { $attributeId = $attribute; if (is_object($attribute)) { $attributeId = $attribute->getAttributeId(); } return $attributeId; }
[ "private", "function", "getAttributeId", "(", "$", "attribute", ")", "{", "$", "attributeId", "=", "$", "attribute", ";", "if", "(", "is_object", "(", "$", "attribute", ")", ")", "{", "$", "attributeId", "=", "$", "attribute", "->", "getAttributeId", "(", ...
This util method is used to ensure the attribute is an integer and uses it's id if it is an object. @param AttributeInterface|integer $attribute Product attribute. @return integer
[ "This", "util", "method", "is", "used", "to", "ensure", "the", "attribute", "is", "an", "integer", "and", "uses", "it", "s", "id", "if", "it", "is", "an", "object", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Helper/AbstractAttribute.php#L318-L327
Smile-SA/elasticsuite
src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Structure/Element/Visibility.php
Visibility.isVisible
public function isVisible(\Magento\Config\Model\Config\Structure\AbstractElement $element, $scope) { if ($element->getAttribute('if_module_enabled') && !$this->moduleManager->isOutputEnabled($element->getAttribute('if_module_enabled')) ) { return false; } $sh...
php
public function isVisible(\Magento\Config\Model\Config\Structure\AbstractElement $element, $scope) { if ($element->getAttribute('if_module_enabled') && !$this->moduleManager->isOutputEnabled($element->getAttribute('if_module_enabled')) ) { return false; } $sh...
[ "public", "function", "isVisible", "(", "\\", "Magento", "\\", "Config", "\\", "Model", "\\", "Config", "\\", "Structure", "\\", "AbstractElement", "$", "element", ",", "$", "scope", ")", "{", "if", "(", "$", "element", "->", "getAttribute", "(", "'if_modu...
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/Visibility.php#L59-L80
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Block/Navigation/Renderer/Attribute.php
Attribute.getJsLayout
public function getJsLayout() { $filterItems = $this->getFilter()->getItems(); $jsLayoutConfig = [ 'component' => self::JS_COMPONENT, 'maxSize' => (int) $this->getFilter()->getAttributeModel()->getFacetMaxSize(), 'displayProductCount' => ...
php
public function getJsLayout() { $filterItems = $this->getFilter()->getItems(); $jsLayoutConfig = [ 'component' => self::JS_COMPONENT, 'maxSize' => (int) $this->getFilter()->getAttributeModel()->getFacetMaxSize(), 'displayProductCount' => ...
[ "public", "function", "getJsLayout", "(", ")", "{", "$", "filterItems", "=", "$", "this", "->", "getFilter", "(", ")", "->", "getItems", "(", ")", ";", "$", "jsLayoutConfig", "=", "[", "'component'", "=>", "self", "::", "JS_COMPONENT", ",", "'maxSize'", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/Renderer/Attribute.php#L40-L57
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Block/Navigation/Renderer/Attribute.php
Attribute.getAjaxLoadUrl
private function getAjaxLoadUrl() { $qsParams = ['filterName' => $this->getFilter()->getRequestVar()]; $currentCategory = $this->getFilter()->getLayer()->getCurrentCategory(); if ($currentCategory && $currentCategory->getId() && $currentCategory->getLevel() > 1) { $qsParams['ca...
php
private function getAjaxLoadUrl() { $qsParams = ['filterName' => $this->getFilter()->getRequestVar()]; $currentCategory = $this->getFilter()->getLayer()->getCurrentCategory(); if ($currentCategory && $currentCategory->getId() && $currentCategory->getLevel() > 1) { $qsParams['ca...
[ "private", "function", "getAjaxLoadUrl", "(", ")", "{", "$", "qsParams", "=", "[", "'filterName'", "=>", "$", "this", "->", "getFilter", "(", ")", "->", "getRequestVar", "(", ")", "]", ";", "$", "currentCategory", "=", "$", "this", "->", "getFilter", "("...
Get the AJAX load URL (used by the show more and the search features). @return string
[ "Get", "the", "AJAX", "load", "URL", "(", "used", "by", "the", "show", "more", "and", "the", "search", "features", ")", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/Renderer/Attribute.php#L72-L85
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Collection/Provider/Only.php
Only.getCollection
public function getCollection(ContainerConfigurationInterface $containerConfiguration) { $collection = $this->optimizerCollectionFactory->create(); // Force an empty collection loading. $collection->addFieldToFilter('main_table.' . OptimizerInterface::OPTIMIZER_ID, ['eq' => 0]); //...
php
public function getCollection(ContainerConfigurationInterface $containerConfiguration) { $collection = $this->optimizerCollectionFactory->create(); // Force an empty collection loading. $collection->addFieldToFilter('main_table.' . OptimizerInterface::OPTIMIZER_ID, ['eq' => 0]); //...
[ "public", "function", "getCollection", "(", "ContainerConfigurationInterface", "$", "containerConfiguration", ")", "{", "$", "collection", "=", "$", "this", "->", "optimizerCollectionFactory", "->", "create", "(", ")", ";", "// Force an empty collection loading.", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Collection/Provider/Only.php#L63-L74
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Combine.php
Combine.getNewChildSelectOptions
public function getNewChildSelectOptions() { $productAttributes = $this->productConditionFactory->create()->loadAttributeOptions()->getAttributeOption(); $attributes = []; $productConditionType = get_class($this->productConditionFactory->create()); foreach ($productAttributes as $c...
php
public function getNewChildSelectOptions() { $productAttributes = $this->productConditionFactory->create()->loadAttributeOptions()->getAttributeOption(); $attributes = []; $productConditionType = get_class($this->productConditionFactory->create()); foreach ($productAttributes as $c...
[ "public", "function", "getNewChildSelectOptions", "(", ")", "{", "$", "productAttributes", "=", "$", "this", "->", "productConditionFactory", "->", "create", "(", ")", "->", "loadAttributeOptions", "(", ")", "->", "getAttributeOption", "(", ")", ";", "$", "attri...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Combine.php#L66-L97
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Combine.php
Combine.loadArray
public function loadArray($arr, $key = 'conditions') { $aggregator = $this->getAggregatorFromArray($arr); $value = $this->getValueFromArray($arr); $this->setAggregator($aggregator) ->setValue($value); if (!empty($arr[$key]) && is_array($arr[$key])) { fo...
php
public function loadArray($arr, $key = 'conditions') { $aggregator = $this->getAggregatorFromArray($arr); $value = $this->getValueFromArray($arr); $this->setAggregator($aggregator) ->setValue($value); if (!empty($arr[$key]) && is_array($arr[$key])) { fo...
[ "public", "function", "loadArray", "(", "$", "arr", ",", "$", "key", "=", "'conditions'", ")", "{", "$", "aggregator", "=", "$", "this", "->", "getAggregatorFromArray", "(", "$", "arr", ")", ";", "$", "value", "=", "$", "this", "->", "getValueFromArray",...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Combine.php#L102-L125
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes.php
FilterableAttributes.getAggregations
public function getAggregations( $storeId, $query = null, $filters = [], $queryFilters = [] ) { $attributes = $this->attributeList->getList(); foreach ($this->modifiersPool as $modifier) { $attributes = $modifier->modifyAttributes($storeId, $this->request...
php
public function getAggregations( $storeId, $query = null, $filters = [], $queryFilters = [] ) { $attributes = $this->attributeList->getList(); foreach ($this->modifiersPool as $modifier) { $attributes = $modifier->modifyAttributes($storeId, $this->request...
[ "public", "function", "getAggregations", "(", "$", "storeId", ",", "$", "query", "=", "null", ",", "$", "filters", "=", "[", "]", ",", "$", "queryFilters", "=", "[", "]", ")", "{", "$", "attributes", "=", "$", "this", "->", "attributeList", "->", "ge...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes.php#L72-L91
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes.php
FilterableAttributes.getAggregationsConfig
private function getAggregationsConfig($attributes) { $aggregations = []; foreach ($attributes as $attribute) { $bucketConfig = $this->getBucketConfig($attribute); $aggregations[$bucketConfig['name']] = $bucketConfig; } return $aggregat...
php
private function getAggregationsConfig($attributes) { $aggregations = []; foreach ($attributes as $attribute) { $bucketConfig = $this->getBucketConfig($attribute); $aggregations[$bucketConfig['name']] = $bucketConfig; } return $aggregat...
[ "private", "function", "getAggregationsConfig", "(", "$", "attributes", ")", "{", "$", "aggregations", "=", "[", "]", ";", "foreach", "(", "$", "attributes", "as", "$", "attribute", ")", "{", "$", "bucketConfig", "=", "$", "this", "->", "getBucketConfig", ...
Get aggregations config. @param \Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection $attributes The attributes @return array
[ "Get", "aggregations", "config", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes.php#L100-L109
Smile-SA/elasticsuite
src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Initial/Converter.php
Converter.convert
public function convert($source) { $output = []; $xpath = new \DOMXPath($source); $this->metadata = []; /** @var $node \DOMNode */ foreach ($xpath->query(implode(' | ', $this->nodeMap)) as $node) { $output = array_merge($output, $this->convertNode($node)); ...
php
public function convert($source) { $output = []; $xpath = new \DOMXPath($source); $this->metadata = []; /** @var $node \DOMNode */ foreach ($xpath->query(implode(' | ', $this->nodeMap)) as $node) { $output = array_merge($output, $this->convertNode($node)); ...
[ "public", "function", "convert", "(", "$", "source", ")", "{", "$", "output", "=", "[", "]", ";", "$", "xpath", "=", "new", "\\", "DOMXPath", "(", "$", "source", ")", ";", "$", "this", "->", "metadata", "=", "[", "]", ";", "/** @var $node \\DOMNode *...
Convert config @param \DOMDocument $source The source document @return array
[ "Convert", "config" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Initial/Converter.php#L54-L68
Smile-SA/elasticsuite
src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Initial/Converter.php
Converter.convertNode
protected function convertNode(\DOMNode $node, $path = '') { $output = []; if ($node->nodeType == XML_ELEMENT_NODE) { $nodeName = $this->parseNodeName($node); $output[$nodeName] = $this->parseNodeData($node, $path); } elseif ($node->nodeType == XML_CDATA_SECTION_NODE ...
php
protected function convertNode(\DOMNode $node, $path = '') { $output = []; if ($node->nodeType == XML_ELEMENT_NODE) { $nodeName = $this->parseNodeName($node); $output[$nodeName] = $this->parseNodeData($node, $path); } elseif ($node->nodeType == XML_CDATA_SECTION_NODE ...
[ "protected", "function", "convertNode", "(", "\\", "DOMNode", "$", "node", ",", "$", "path", "=", "''", ")", "{", "$", "output", "=", "[", "]", ";", "if", "(", "$", "node", "->", "nodeType", "==", "XML_ELEMENT_NODE", ")", "{", "$", "nodeName", "=", ...
Convert node oto array @param \DOMNode $node The Configuration DOM node to parse @param string $path The path for DOM navigation @return array|string|null
[ "Convert", "node", "oto", "array" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Initial/Converter.php#L78-L90
Smile-SA/elasticsuite
src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Initial/Converter.php
Converter.parseNodeName
protected function parseNodeName($node) { $nodeName = $node->nodeName; if ($node->hasAttributes()) { $storeCodeNode = $node->attributes->getNamedItem('store_code'); $containerNameNode = $node->attributes->getNamedItem('name'); if ($containerNameNode) { ...
php
protected function parseNodeName($node) { $nodeName = $node->nodeName; if ($node->hasAttributes()) { $storeCodeNode = $node->attributes->getNamedItem('store_code'); $containerNameNode = $node->attributes->getNamedItem('name'); if ($containerNameNode) { ...
[ "protected", "function", "parseNodeName", "(", "$", "node", ")", "{", "$", "nodeName", "=", "$", "node", "->", "nodeName", ";", "if", "(", "$", "node", "->", "hasAttributes", "(", ")", ")", "{", "$", "storeCodeNode", "=", "$", "node", "->", "attributes...
Retrieve proper node name @param \DOMNode $node The configuration XML node to parse @return string
[ "Retrieve", "proper", "node", "name" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Initial/Converter.php#L99-L114
Smile-SA/elasticsuite
src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Initial/Converter.php
Converter.parseNodeData
private function parseNodeData(\DOMNode $node, $path) { $nodeData = []; foreach ($node->childNodes as $childNode) { $childrenData = $this->convertNode($childNode, ($path ? $path . '/' : '') . $childNode->nodeName); if ($childrenData === null) { continue; ...
php
private function parseNodeData(\DOMNode $node, $path) { $nodeData = []; foreach ($node->childNodes as $childNode) { $childrenData = $this->convertNode($childNode, ($path ? $path . '/' : '') . $childNode->nodeName); if ($childrenData === null) { continue; ...
[ "private", "function", "parseNodeData", "(", "\\", "DOMNode", "$", "node", ",", "$", "path", ")", "{", "$", "nodeData", "=", "[", "]", ";", "foreach", "(", "$", "node", "->", "childNodes", "as", "$", "childNode", ")", "{", "$", "childrenData", "=", "...
Convert node onto array @param \DOMNode $node The Configuration DOM node to parse @param string $path The path for DOM navigation @return array|string|null
[ "Convert", "node", "onto", "array" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Initial/Converter.php#L124-L141
Smile-SA/elasticsuite
src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Initial/Converter.php
Converter.mergeChildData
private function mergeChildData($nodeData, $childrenData) { if (is_array($childrenData)) { $nodeData = array_merge($nodeData, $childrenData); return $nodeData; } $nodeData = $childrenData; return $nodeData; }
php
private function mergeChildData($nodeData, $childrenData) { if (is_array($childrenData)) { $nodeData = array_merge($nodeData, $childrenData); return $nodeData; } $nodeData = $childrenData; return $nodeData; }
[ "private", "function", "mergeChildData", "(", "$", "nodeData", ",", "$", "childrenData", ")", "{", "if", "(", "is_array", "(", "$", "childrenData", ")", ")", "{", "$", "nodeData", "=", "array_merge", "(", "$", "nodeData", ",", "$", "childrenData", ")", "...
Merge child node data into current node @param array $nodeData Current node data @param array $childrenData The child node data @return array
[ "Merge", "child", "node", "data", "into", "current", "node" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Initial/Converter.php#L151-L162
Smile-SA/elasticsuite
src/module-elasticsuite-analytics/Model/Search/Usage/Terms/Report.php
Report.processResponse
protected function processResponse(\Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\QueryResponse $response) { $data = []; foreach ($this->getValues($response) as $value) { $searchTerm = $value->getValue(); if ($searchTerm !== '__other_docs') { $d...
php
protected function processResponse(\Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\QueryResponse $response) { $data = []; foreach ($this->getValues($response) as $value) { $searchTerm = $value->getValue(); if ($searchTerm !== '__other_docs') { $d...
[ "protected", "function", "processResponse", "(", "\\", "Smile", "\\", "ElasticsuiteCore", "\\", "Search", "\\", "Adapter", "\\", "Elasticsuite", "\\", "Response", "\\", "QueryResponse", "$", "response", ")", "{", "$", "data", "=", "[", "]", ";", "foreach", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Search/Usage/Terms/Report.php#L51-L76
Smile-SA/elasticsuite
src/module-elasticsuite-analytics/Model/Search/Usage/Terms/Report.php
Report.getValues
private function getValues(\Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\QueryResponse $response) { $bucket = $response->getAggregations()->getBucket('search_terms'); return $bucket !== null ? $bucket->getValues() : []; }
php
private function getValues(\Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\QueryResponse $response) { $bucket = $response->getAggregations()->getBucket('search_terms'); return $bucket !== null ? $bucket->getValues() : []; }
[ "private", "function", "getValues", "(", "\\", "Smile", "\\", "ElasticsuiteCore", "\\", "Search", "\\", "Adapter", "\\", "Elasticsuite", "\\", "Response", "\\", "QueryResponse", "$", "response", ")", "{", "$", "bucket", "=", "$", "response", "->", "getAggregat...
Return the bucket values from the main aggregation @param \Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\QueryResponse $response ES Query response. @return \Magento\Framework\Api\Search\AggregationValueInterface[]
[ "Return", "the", "bucket", "values", "from", "the", "main", "aggregation" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Search/Usage/Terms/Report.php#L85-L90
Smile-SA/elasticsuite
src/module-elasticsuite-core/Client/ClientConfiguration.php
ClientConfiguration.isHttpAuthEnabled
public function isHttpAuthEnabled() { $authEnabled = (bool) $this->getElasticsearchClientConfigParam('enable_http_auth'); return $authEnabled && !empty($this->getHttpAuthUser()) && !empty($this->getHttpAuthPassword()); }
php
public function isHttpAuthEnabled() { $authEnabled = (bool) $this->getElasticsearchClientConfigParam('enable_http_auth'); return $authEnabled && !empty($this->getHttpAuthUser()) && !empty($this->getHttpAuthPassword()); }
[ "public", "function", "isHttpAuthEnabled", "(", ")", "{", "$", "authEnabled", "=", "(", "bool", ")", "$", "this", "->", "getElasticsearchClientConfigParam", "(", "'enable_http_auth'", ")", ";", "return", "$", "authEnabled", "&&", "!", "empty", "(", "$", "this"...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Client/ClientConfiguration.php#L84-L89
Smile-SA/elasticsuite
src/module-elasticsuite-core/Client/ClientConfiguration.php
ClientConfiguration.getOptions
public function getOptions() { $options = [ 'servers' => $this->getServerList(), 'scheme' => $this->getScheme(), 'enable_http_auth' => $this->isHttpAuthEnabled(), 'http_auth_user' => $this->getHttpAuthUser(), ...
php
public function getOptions() { $options = [ 'servers' => $this->getServerList(), 'scheme' => $this->getScheme(), 'enable_http_auth' => $this->isHttpAuthEnabled(), 'http_auth_user' => $this->getHttpAuthUser(), ...
[ "public", "function", "getOptions", "(", ")", "{", "$", "options", "=", "[", "'servers'", "=>", "$", "this", "->", "getServerList", "(", ")", ",", "'scheme'", "=>", "$", "this", "->", "getScheme", "(", ")", ",", "'enable_http_auth'", "=>", "$", "this", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Client/ClientConfiguration.php#L110-L122
Smile-SA/elasticsuite
src/module-elasticsuite-core/Client/ClientConfiguration.php
ClientConfiguration.getElasticsearchClientConfigParam
private function getElasticsearchClientConfigParam($configField) { $path = self::ES_CLIENT_CONFIG_XML_PREFIX . '/' . $configField; return $this->scopeConfig->getValue($path); }
php
private function getElasticsearchClientConfigParam($configField) { $path = self::ES_CLIENT_CONFIG_XML_PREFIX . '/' . $configField; return $this->scopeConfig->getValue($path); }
[ "private", "function", "getElasticsearchClientConfigParam", "(", "$", "configField", ")", "{", "$", "path", "=", "self", "::", "ES_CLIENT_CONFIG_XML_PREFIX", ".", "'/'", ".", "$", "configField", ";", "return", "$", "this", "->", "scopeConfig", "->", "getValue", ...
Read config under the path smile_elasticsuite_core_base_settings/es_client. @param string $configField Field name. @return mixed
[ "Read", "config", "under", "the", "path", "smile_elasticsuite_core_base_settings", "/", "es_client", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Client/ClientConfiguration.php#L131-L136
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php
Collection.addStoreFilter
public function addStoreFilter($storeIds) { $defaultStoreId = Store::DEFAULT_STORE_ID; if (!is_array($storeIds)) { $storeIds = [$storeIds]; } if (!in_array($defaultStoreId, $storeIds)) { $storeIds[] = $defaultStoreId; } $this->getSelect() ...
php
public function addStoreFilter($storeIds) { $defaultStoreId = Store::DEFAULT_STORE_ID; if (!is_array($storeIds)) { $storeIds = [$storeIds]; } if (!in_array($defaultStoreId, $storeIds)) { $storeIds[] = $defaultStoreId; } $this->getSelect() ...
[ "public", "function", "addStoreFilter", "(", "$", "storeIds", ")", "{", "$", "defaultStoreId", "=", "Store", "::", "DEFAULT_STORE_ID", ";", "if", "(", "!", "is_array", "(", "$", "storeIds", ")", ")", "{", "$", "storeIds", "=", "[", "$", "storeIds", "]", ...
Filter collection by specified store ids @param array|int $storeIds The store ids to filter @return $this
[ "Filter", "collection", "by", "specified", "store", "ids" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php#L130-L151
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php
Collection._renderFiltersBefore
protected function _renderFiltersBefore() { if ($this->getFilter('store')) { $this->getSelect()->join( ['store_table' => $this->getTable(ThesaurusInterface::STORE_TABLE_NAME)], 'main_table.' . ThesaurusInterface::THESAURUS_ID . ' = store_table.' . ThesaurusInterfa...
php
protected function _renderFiltersBefore() { if ($this->getFilter('store')) { $this->getSelect()->join( ['store_table' => $this->getTable(ThesaurusInterface::STORE_TABLE_NAME)], 'main_table.' . ThesaurusInterface::THESAURUS_ID . ' = store_table.' . ThesaurusInterfa...
[ "protected", "function", "_renderFiltersBefore", "(", ")", "{", "if", "(", "$", "this", "->", "getFilter", "(", "'store'", ")", ")", "{", "$", "this", "->", "getSelect", "(", ")", "->", "join", "(", "[", "'store_table'", "=>", "$", "this", "->", "getTa...
Join store relation table if there is store filter @SuppressWarnings(PHPMD.CamelCaseMethodName)
[ "Join", "store", "relation", "table", "if", "there", "is", "store", "filter" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php#L158-L171
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php
Collection.addTermFilterToSelect
private function addTermFilterToSelect($term) { $select = $this->getSelect(); if ($this->termsLinked === false) { $select->joinLeft( ['expansion_table' => $this->getTable(ThesaurusInterface::EXPANSION_TABLE_NAME)], new \Zend_Db_Expr("main_table.thesaurus_...
php
private function addTermFilterToSelect($term) { $select = $this->getSelect(); if ($this->termsLinked === false) { $select->joinLeft( ['expansion_table' => $this->getTable(ThesaurusInterface::EXPANSION_TABLE_NAME)], new \Zend_Db_Expr("main_table.thesaurus_...
[ "private", "function", "addTermFilterToSelect", "(", "$", "term", ")", "{", "$", "select", "=", "$", "this", "->", "getSelect", "(", ")", ";", "if", "(", "$", "this", "->", "termsLinked", "===", "false", ")", "{", "$", "select", "->", "joinLeft", "(", ...
Inject terms data on collection @param string $term Term filter text. @return $this
[ "Inject", "terms", "data", "on", "collection" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php#L208-L239
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php
Collection.loadStores
private function loadStores() { $itemIds = array_keys($this->_items); if (count($itemIds)) { $connection = $this->getConnection(); $select = $connection->select() ->from(['thesaurus_entity_store' => $this->getTable(ThesaurusInterface::STORE_TABLE_NAME)]) ...
php
private function loadStores() { $itemIds = array_keys($this->_items); if (count($itemIds)) { $connection = $this->getConnection(); $select = $connection->select() ->from(['thesaurus_entity_store' => $this->getTable(ThesaurusInterface::STORE_TABLE_NAME)]) ...
[ "private", "function", "loadStores", "(", ")", "{", "$", "itemIds", "=", "array_keys", "(", "$", "this", "->", "_items", ")", ";", "if", "(", "count", "(", "$", "itemIds", ")", ")", "{", "$", "connection", "=", "$", "this", "->", "getConnection", "("...
Perform operations after collection load @return void
[ "Perform", "operations", "after", "collection", "load" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php#L246-L279
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php
Collection.loadTermsData
private function loadTermsData() { $select = $this->getConnection()->select(); $itemIds = array_keys($this->_items); $select->from(['exp' => $this->getTable(ThesaurusInterface::EXPANSION_TABLE_NAME)], []) ->joinLeft( ['ref' => $this->getTable(ThesaurusInterface:...
php
private function loadTermsData() { $select = $this->getConnection()->select(); $itemIds = array_keys($this->_items); $select->from(['exp' => $this->getTable(ThesaurusInterface::EXPANSION_TABLE_NAME)], []) ->joinLeft( ['ref' => $this->getTable(ThesaurusInterface:...
[ "private", "function", "loadTermsData", "(", ")", "{", "$", "select", "=", "$", "this", "->", "getConnection", "(", ")", "->", "select", "(", ")", ";", "$", "itemIds", "=", "array_keys", "(", "$", "this", "->", "_items", ")", ";", "$", "select", "->"...
Perform operations after collection load @return void
[ "Perform", "operations", "after", "collection", "load" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php#L286-L309
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php
Collection.addTermData
private function addTermData($termData) { $labelsByThesaurusId = []; foreach ($termData as $currentTerm) { $label = $currentTerm['expansions_terms']; if (isset($currentTerm['expanded_term']) && $currentTerm['expanded_term']) { $label = sprintf("%s => %s", $c...
php
private function addTermData($termData) { $labelsByThesaurusId = []; foreach ($termData as $currentTerm) { $label = $currentTerm['expansions_terms']; if (isset($currentTerm['expanded_term']) && $currentTerm['expanded_term']) { $label = sprintf("%s => %s", $c...
[ "private", "function", "addTermData", "(", "$", "termData", ")", "{", "$", "labelsByThesaurusId", "=", "[", "]", ";", "foreach", "(", "$", "termData", "as", "$", "currentTerm", ")", "{", "$", "label", "=", "$", "currentTerm", "[", "'expansions_terms'", "]"...
Process terms of each thesaurus and display a summary for each thesaurus. @param array $termData Raw terms data loaded from the DB. @return $this
[ "Process", "terms", "of", "each", "thesaurus", "and", "display", "a", "summary", "for", "each", "thesaurus", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus/Collection.php#L318-L337
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Model/ThesaurusRepository.php
ThesaurusRepository.getById
public function getById($thesaurusId) { if (!isset($this->thesaurusRepositoryById[$thesaurusId])) { /** @var ThesaurusInterface $thesaurus */ $thesaurus = $this->thesaurusFactory->create()->load($thesaurusId); if (!$thesaurus->getThesaurusId()) { throw NoS...
php
public function getById($thesaurusId) { if (!isset($this->thesaurusRepositoryById[$thesaurusId])) { /** @var ThesaurusInterface $thesaurus */ $thesaurus = $this->thesaurusFactory->create()->load($thesaurusId); if (!$thesaurus->getThesaurusId()) { throw NoS...
[ "public", "function", "getById", "(", "$", "thesaurusId", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "thesaurusRepositoryById", "[", "$", "thesaurusId", "]", ")", ")", "{", "/** @var ThesaurusInterface $thesaurus */", "$", "thesaurus", "=", "$"...
Retrieve a thesaurus by its ID @SuppressWarnings(PHPMD.StaticAccess) Mandatory to throw the exception via static access to be compliant with Magento Extension Quality Program @param int $thesaurusId id of the thesaurus @return \Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface @throws \Magento\Framework\Except...
[ "Retrieve", "a", "thesaurus", "by", "its", "ID" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ThesaurusRepository.php#L98-L111
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Model/ThesaurusRepository.php
ThesaurusRepository.save
public function save(\Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface $thesaurus) { $this->validate($thesaurus); $thesaurus->save(); $this->thesaurusRepositoryById[$thesaurus->getThesaurusId()] = $thesaurus; return $thesaurus; }
php
public function save(\Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface $thesaurus) { $this->validate($thesaurus); $thesaurus->save(); $this->thesaurusRepositoryById[$thesaurus->getThesaurusId()] = $thesaurus; return $thesaurus; }
[ "public", "function", "save", "(", "\\", "Smile", "\\", "ElasticsuiteThesaurus", "\\", "Api", "\\", "Data", "\\", "ThesaurusInterface", "$", "thesaurus", ")", "{", "$", "this", "->", "validate", "(", "$", "thesaurus", ")", ";", "$", "thesaurus", "->", "sav...
Save a thesaurus @param \Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface $thesaurus Thesaurus data @return \Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface @throws \Magento\Framework\Exception\NoSuchEntityException
[ "Save", "a", "thesaurus" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ThesaurusRepository.php#L122-L131
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Model/ThesaurusRepository.php
ThesaurusRepository.delete
public function delete(\Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface $thesaurus) { $thesaurusId = $thesaurus->getThesaurusId(); $thesaurus->delete(); if (isset($this->thesaurusRepositoryById[$thesaurusId])) { unset($this->thesaurusRepositoryById[$thesaurusId]); ...
php
public function delete(\Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface $thesaurus) { $thesaurusId = $thesaurus->getThesaurusId(); $thesaurus->delete(); if (isset($this->thesaurusRepositoryById[$thesaurusId])) { unset($this->thesaurusRepositoryById[$thesaurusId]); ...
[ "public", "function", "delete", "(", "\\", "Smile", "\\", "ElasticsuiteThesaurus", "\\", "Api", "\\", "Data", "\\", "ThesaurusInterface", "$", "thesaurus", ")", "{", "$", "thesaurusId", "=", "$", "thesaurus", "->", "getThesaurusId", "(", ")", ";", "$", "thes...
Delete a thesaurus @param \Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface $thesaurus Thesaurus data @throws \Magento\Framework\Exception\NoSuchEntityException @return \Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface
[ "Delete", "a", "thesaurus" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ThesaurusRepository.php#L142-L153
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Model/ThesaurusRepository.php
ThesaurusRepository.validate
protected function validate(\Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface $thesaurus) { $exception = new \Magento\Framework\Exception\InputException(); $validator = new \Zend_Validate(); if (!$validator->is(trim($thesaurus->getName()), 'NotEmpty')) { $exception->addEr...
php
protected function validate(\Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface $thesaurus) { $exception = new \Magento\Framework\Exception\InputException(); $validator = new \Zend_Validate(); if (!$validator->is(trim($thesaurus->getName()), 'NotEmpty')) { $exception->addEr...
[ "protected", "function", "validate", "(", "\\", "Smile", "\\", "ElasticsuiteThesaurus", "\\", "Api", "\\", "Data", "\\", "ThesaurusInterface", "$", "thesaurus", ")", "{", "$", "exception", "=", "new", "\\", "Magento", "\\", "Framework", "\\", "Exception", "\\"...
Validate thesaurus values @param \Smile\ElasticsuiteThesaurus\Api\Data\ThesaurusInterface $thesaurus the thesaurus to validate @return void @throws \Magento\Framework\Exception\InputException
[ "Validate", "thesaurus", "values" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ThesaurusRepository.php#L163-L175
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/Deprecation/InventoryData.php
InventoryData.loadInventoryData
public function loadInventoryData($storeId, $productIds) { $websiteId = $this->getWebsiteId($storeId); $stockId = $this->getStockId($websiteId); $select = $this->getConnection()->select() ->from(['ciss' => $this->getTable('cataloginventory_stock_status')], ['product_id', 'stoc...
php
public function loadInventoryData($storeId, $productIds) { $websiteId = $this->getWebsiteId($storeId); $stockId = $this->getStockId($websiteId); $select = $this->getConnection()->select() ->from(['ciss' => $this->getTable('cataloginventory_stock_status')], ['product_id', 'stoc...
[ "public", "function", "loadInventoryData", "(", "$", "storeId", ",", "$", "productIds", ")", "{", "$", "websiteId", "=", "$", "this", "->", "getWebsiteId", "(", "$", "storeId", ")", ";", "$", "stockId", "=", "$", "this", "->", "getStockId", "(", "$", "...
Load inventory data for a list of product ids and a given store. @param integer $storeId Store id. @param array $productIds Product ids list. @return array
[ "Load", "inventory", "data", "for", "a", "list", "of", "product", "ids", "and", "a", "given", "store", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/Deprecation/InventoryData.php#L81-L93
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/Deprecation/InventoryData.php
InventoryData.getStockId
private function getStockId($websiteId) { if (!isset($this->stockIdByWebsite[$websiteId])) { $stockId = $this->stockRegistry->getStock($websiteId)->getStockId(); $this->stockIdByWebsite[$websiteId] = $stockId; } return $this->stockIdByWebsite[$websiteId]; }
php
private function getStockId($websiteId) { if (!isset($this->stockIdByWebsite[$websiteId])) { $stockId = $this->stockRegistry->getStock($websiteId)->getStockId(); $this->stockIdByWebsite[$websiteId] = $stockId; } return $this->stockIdByWebsite[$websiteId]; }
[ "private", "function", "getStockId", "(", "$", "websiteId", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "stockIdByWebsite", "[", "$", "websiteId", "]", ")", ")", "{", "$", "stockId", "=", "$", "this", "->", "stockRegistry", "->", "getSto...
Retrieve stock_id by store @param int $websiteId The website Id @return int
[ "Retrieve", "stock_id", "by", "store" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/Deprecation/InventoryData.php#L102-L110
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Action/Full.php
Full.rebuildStoreIndex
public function rebuildStoreIndex($storeId, $productIds = null) { $productId = 0; // Magento is only sending children ids here. Ensure to reindex also the parents product ids, if any. if (!empty($productIds)) { $productIds = array_unique(array_merge($productIds, $this->resourceM...
php
public function rebuildStoreIndex($storeId, $productIds = null) { $productId = 0; // Magento is only sending children ids here. Ensure to reindex also the parents product ids, if any. if (!empty($productIds)) { $productIds = array_unique(array_merge($productIds, $this->resourceM...
[ "public", "function", "rebuildStoreIndex", "(", "$", "storeId", ",", "$", "productIds", "=", "null", ")", "{", "$", "productId", "=", "0", ";", "// Magento is only sending children ids here. Ensure to reindex also the parents product ids, if any.", "if", "(", "!", "empty"...
Get data for a list of product in a store id. If the product list ids is null, all products data will be loaded. @param integer $storeId Store id. @param array|null $productIds List of product ids. @return array
[ "Get", "data", "for", "a", "list", "of", "product", "in", "a", "store", "id", ".", "If", "the", "product", "list", "ids", "is", "null", "all", "products", "data", "will", "be", "loaded", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Action/Full.php#L52-L71
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Action/Full.php
Full.getSearchableProducts
private function getSearchableProducts($storeId, $productIds = null, $fromId = 0, $limit = 10000) { return $this->resourceModel->getSearchableProducts($storeId, $productIds, $fromId, $limit); }
php
private function getSearchableProducts($storeId, $productIds = null, $fromId = 0, $limit = 10000) { return $this->resourceModel->getSearchableProducts($storeId, $productIds, $fromId, $limit); }
[ "private", "function", "getSearchableProducts", "(", "$", "storeId", ",", "$", "productIds", "=", "null", ",", "$", "fromId", "=", "0", ",", "$", "limit", "=", "10000", ")", "{", "return", "$", "this", "->", "resourceModel", "->", "getSearchableProducts", ...
Load a bulk of product data. @param int $storeId Store id. @param string $productIds Product ids filter. @param integer $fromId Load product with id greater than. @param integer $limit Number of product to get loaded. @return array
[ "Load", "a", "bulk", "of", "product", "data", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Action/Full.php#L83-L86
Smile-SA/elasticsuite
src/module-elasticsuite-tracker/Model/Event/Processor/ProductListFilters.php
ProductListFilters.process
public function process($eventData) { if (isset($eventData['page']['product_list']['filters'])) { $filters = []; foreach ($eventData['page']['product_list']['filters'] as $filterName => $filterValues) { $filterValues = explode('|', $filterValues); fore...
php
public function process($eventData) { if (isset($eventData['page']['product_list']['filters'])) { $filters = []; foreach ($eventData['page']['product_list']['filters'] as $filterName => $filterValues) { $filterValues = explode('|', $filterValues); fore...
[ "public", "function", "process", "(", "$", "eventData", ")", "{", "if", "(", "isset", "(", "$", "eventData", "[", "'page'", "]", "[", "'product_list'", "]", "[", "'filters'", "]", ")", ")", "{", "$", "filters", "=", "[", "]", ";", "foreach", "(", "...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/Event/Processor/ProductListFilters.php#L31-L45