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-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php
FrontPlugin.addFacetFields
private function addFacetFields(Fieldset $fieldset) { $fieldset->addField( 'facet_min_coverage_rate', 'text', [ 'name' => 'facet_min_coverage_rate', 'label' => __('Facet coverage rate'), 'class' => 'validate-digits validate...
php
private function addFacetFields(Fieldset $fieldset) { $fieldset->addField( 'facet_min_coverage_rate', 'text', [ 'name' => 'facet_min_coverage_rate', 'label' => __('Facet coverage rate'), 'class' => 'validate-digits validate...
[ "private", "function", "addFacetFields", "(", "Fieldset", "$", "fieldset", ")", "{", "$", "fieldset", "->", "addField", "(", "'facet_min_coverage_rate'", ",", "'text'", ",", "[", "'name'", "=>", "'facet_min_coverage_rate'", ",", "'label'", "=>", "__", "(", "'Fac...
Append faceting related fields. @param Fieldset $fieldset Target fieldset @return FrontPlugin
[ "Append", "faceting", "related", "fields", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php#L209-L249
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php
FrontPlugin.addSearchFields
private function addSearchFields(Fieldset $fieldset) { $fieldset->addField( 'search_weight', 'select', [ 'name' => 'search_weight', 'label' => __('Search Weight'), 'values' => $this->weightSource->getOptions(), ]...
php
private function addSearchFields(Fieldset $fieldset) { $fieldset->addField( 'search_weight', 'select', [ 'name' => 'search_weight', 'label' => __('Search Weight'), 'values' => $this->weightSource->getOptions(), ]...
[ "private", "function", "addSearchFields", "(", "Fieldset", "$", "fieldset", ")", "{", "$", "fieldset", "->", "addField", "(", "'search_weight'", ",", "'select'", ",", "[", "'name'", "=>", "'search_weight'", ",", "'label'", "=>", "__", "(", "'Search Weight'", "...
Append spellchecking related fields. @param Fieldset $fieldset Target fieldset @return FrontPlugin
[ "Append", "spellchecking", "related", "fields", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php#L258-L283
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php
FrontPlugin.addSortFields
private function addSortFields(Fieldset $fieldset) { $sortFieldsOptions = [ ['value' => '_first', 'label' => __("First")], ['value' => '_last', 'label' => __("Last")], ]; $fieldset->addField( 'sort_order_asc_missing', 'select', [ ...
php
private function addSortFields(Fieldset $fieldset) { $sortFieldsOptions = [ ['value' => '_first', 'label' => __("First")], ['value' => '_last', 'label' => __("Last")], ]; $fieldset->addField( 'sort_order_asc_missing', 'select', [ ...
[ "private", "function", "addSortFields", "(", "Fieldset", "$", "fieldset", ")", "{", "$", "sortFieldsOptions", "=", "[", "[", "'value'", "=>", "'_first'", ",", "'label'", "=>", "__", "(", "\"First\"", ")", "]", ",", "[", "'value'", "=>", "'_last'", ",", "...
Append sorting related fields. @param Fieldset $fieldset Target fieldset @return FrontPlugin
[ "Append", "sorting", "related", "fields", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php#L292-L324
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php
FrontPlugin.createDisplayFieldset
private function createDisplayFieldset(Form $form, Front $subject) { $fieldset = $form->addFieldset( 'elasticsuite_catalog_attribute_display_fieldset', [ 'legend' => __('Slider Display Configuration'), 'collapsable' => $subject->getRequest()->has(...
php
private function createDisplayFieldset(Form $form, Front $subject) { $fieldset = $form->addFieldset( 'elasticsuite_catalog_attribute_display_fieldset', [ 'legend' => __('Slider Display Configuration'), 'collapsable' => $subject->getRequest()->has(...
[ "private", "function", "createDisplayFieldset", "(", "Form", "$", "form", ",", "Front", "$", "subject", ")", "{", "$", "fieldset", "=", "$", "form", "->", "addFieldset", "(", "'elasticsuite_catalog_attribute_display_fieldset'", ",", "[", "'legend'", "=>", "__", ...
Append the "Slider Display Configuration" fieldset to the tab. @param Form $form Target form. @param Front $subject Target tab. @return Fieldset
[ "Append", "the", "Slider", "Display", "Configuration", "fieldset", "to", "the", "tab", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php#L334-L346
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php
FrontPlugin.addDisplayFields
private function addDisplayFields(Fieldset $fieldset) { $fieldset->addField( 'display_pattern', 'text', [ 'name' => 'display_pattern', 'label' => __('Display pattern'), 'note' => __('A pattern like %s UNIT where %s is the ...
php
private function addDisplayFields(Fieldset $fieldset) { $fieldset->addField( 'display_pattern', 'text', [ 'name' => 'display_pattern', 'label' => __('Display pattern'), 'note' => __('A pattern like %s UNIT where %s is the ...
[ "private", "function", "addDisplayFields", "(", "Fieldset", "$", "fieldset", ")", "{", "$", "fieldset", "->", "addField", "(", "'display_pattern'", ",", "'text'", ",", "[", "'name'", "=>", "'display_pattern'", ",", "'label'", "=>", "__", "(", "'Display pattern'"...
Append display related fields. @param Fieldset $fieldset Target fieldset @return FrontPlugin
[ "Append", "display", "related", "fields", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php#L355-L381
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php
FrontPlugin.appendSliderDisplayRelatedFields
private function appendSliderDisplayRelatedFields($form, $subject) { $attribute = $this->getAttribute(); $isAttributeDecimal = $attribute->getBackendType() == 'decimal' || $attribute->getFrontendClass() == 'validate-number'; if ($isAttributeDecimal && ($attribute->getFrontendInput(...
php
private function appendSliderDisplayRelatedFields($form, $subject) { $attribute = $this->getAttribute(); $isAttributeDecimal = $attribute->getBackendType() == 'decimal' || $attribute->getFrontendClass() == 'validate-number'; if ($isAttributeDecimal && ($attribute->getFrontendInput(...
[ "private", "function", "appendSliderDisplayRelatedFields", "(", "$", "form", ",", "$", "subject", ")", "{", "$", "attribute", "=", "$", "this", "->", "getAttribute", "(", ")", ";", "$", "isAttributeDecimal", "=", "$", "attribute", "->", "getBackendType", "(", ...
Append slider display related fields @param Form $form The form @param Front $subject The StoreFront tab @return FrontPlugin
[ "Append", "slider", "display", "related", "fields" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php#L391-L402
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php
FrontPlugin.appendFieldsDependency
private function appendFieldsDependency($subject) { /** @var \Magento\Backend\Block\Widget\Form\Element\Dependence $dependencyBlock */ $dependencyBlock = $subject->getChildBlock('form_after'); if ($dependencyBlock) { $dependencyBlock ->addFieldMap('is_displayed_i...
php
private function appendFieldsDependency($subject) { /** @var \Magento\Backend\Block\Widget\Form\Element\Dependence $dependencyBlock */ $dependencyBlock = $subject->getChildBlock('form_after'); if ($dependencyBlock) { $dependencyBlock ->addFieldMap('is_displayed_i...
[ "private", "function", "appendFieldsDependency", "(", "$", "subject", ")", "{", "/** @var \\Magento\\Backend\\Block\\Widget\\Form\\Element\\Dependence $dependencyBlock */", "$", "dependencyBlock", "=", "$", "subject", "->", "getChildBlock", "(", "'form_after'", ")", ";", "if"...
Manage dependency between fields. @param Front $subject The StoreFront tab @return FrontPlugin
[ "Manage", "dependency", "between", "fields", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php#L411-L432
Smile-SA/elasticsuite
src/module-elasticsuite-virtual-category/Setup/InstallSchema.php
InstallSchema.install
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); $this->virtualCategorySetup->createPositionTable($setup); $setup->endSetup(); }
php
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); $this->virtualCategorySetup->createPositionTable($setup); $setup->endSetup(); }
[ "public", "function", "install", "(", "SchemaSetupInterface", "$", "setup", ",", "ModuleContextInterface", "$", "context", ")", "{", "$", "setup", "->", "startSetup", "(", ")", ";", "$", "this", "->", "virtualCategorySetup", "->", "createPositionTable", "(", "$"...
Installs DB schema for the module @SuppressWarnings(PHPMD.UnusedFormalParameter) @param SchemaSetupInterface $setup The setup interface @param ModuleContextInterface $context The module Context @return void
[ "Installs", "DB", "schema", "for", "the", "module" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Setup/InstallSchema.php#L56-L63
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Ui/Component/Optimizer/Source/Config/Attribute/Options.php
Options.getAttributesList
private function getAttributesList() { if (null === $this->attributesList) { $this->attributesList = []; $collection = $this->attributesCollectionFactory->create(); foreach ($collection as $attribute) { $this->attributesList[$attribute->getId()] = [ ...
php
private function getAttributesList() { if (null === $this->attributesList) { $this->attributesList = []; $collection = $this->attributesCollectionFactory->create(); foreach ($collection as $attribute) { $this->attributesList[$attribute->getId()] = [ ...
[ "private", "function", "getAttributesList", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "attributesList", ")", "{", "$", "this", "->", "attributesList", "=", "[", "]", ";", "$", "collection", "=", "$", "this", "->", "attributesCollectionFac...
Retrieve list of attributes that can be used to define virtual attributes rules. @return array
[ "Retrieve", "list", "of", "attributes", "that", "can", "be", "used", "to", "define", "virtual", "attributes", "rules", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Ui/Component/Optimizer/Source/Config/Attribute/Options.php#L60-L76
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php
DataProviderPlugin.aroundGetMeta
public function aroundGetMeta(CategoryDataProvider $dataProvider, \Closure $proceed) { $meta = $proceed(); $currentCategory = $dataProvider->getCurrentCategory(); if ($currentCategory->getId() === null || $currentCategory->getLevel() < 2) { $meta['display_settings']['children']...
php
public function aroundGetMeta(CategoryDataProvider $dataProvider, \Closure $proceed) { $meta = $proceed(); $currentCategory = $dataProvider->getCurrentCategory(); if ($currentCategory->getId() === null || $currentCategory->getLevel() < 2) { $meta['display_settings']['children']...
[ "public", "function", "aroundGetMeta", "(", "CategoryDataProvider", "$", "dataProvider", ",", "\\", "Closure", "$", "proceed", ")", "{", "$", "meta", "=", "$", "proceed", "(", ")", ";", "$", "currentCategory", "=", "$", "dataProvider", "->", "getCurrentCategor...
Remove filter configuration from meta in case of a new category, or a root one. Meta is added in the ui_component via XML. @param CategoryDataProvider $dataProvider Data provider. @param \Closure $proceed Original method. @return array
[ "Remove", "filter", "configuration", "from", "meta", "in", "case", "of", "a", "new", "category", "or", "a", "root", "one", ".", "Meta", "is", "added", "in", "the", "ui_component", "via", "XML", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php#L94-L105
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php
DataProviderPlugin.aroundGetData
public function aroundGetData(CategoryDataProvider $dataProvider, \Closure $proceed) { $data = $proceed(); $currentCategory = $dataProvider->getCurrentCategory(); if ($currentCategory->getId() !== null && $currentCategory->getLevel() >= 2) { $data[$currentCategory->getId()]['fa...
php
public function aroundGetData(CategoryDataProvider $dataProvider, \Closure $proceed) { $data = $proceed(); $currentCategory = $dataProvider->getCurrentCategory(); if ($currentCategory->getId() !== null && $currentCategory->getLevel() >= 2) { $data[$currentCategory->getId()]['fa...
[ "public", "function", "aroundGetData", "(", "CategoryDataProvider", "$", "dataProvider", ",", "\\", "Closure", "$", "proceed", ")", "{", "$", "data", "=", "$", "proceed", "(", ")", ";", "$", "currentCategory", "=", "$", "dataProvider", "->", "getCurrentCategor...
Append filter configuration (sort order and display mode) data. Meta is added in the ui_component via XML. @param CategoryDataProvider $dataProvider Data provider. @param \Closure $proceed Original method. @return array
[ "Append", "filter", "configuration", "(", "sort", "order", "and", "display", "mode", ")", "data", ".", "Meta", "is", "added", "in", "the", "ui_component", "via", "XML", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php#L116-L127
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php
DataProviderPlugin.getFilterableAttributeList
private function getFilterableAttributeList($currentCategory) { $attributesList = []; foreach ($this->getAttributes($currentCategory) as $attribute) { $attributesList[] = [ 'attribute_id' => (int) $attribute->getAttributeId(), 'attr...
php
private function getFilterableAttributeList($currentCategory) { $attributesList = []; foreach ($this->getAttributes($currentCategory) as $attribute) { $attributesList[] = [ 'attribute_id' => (int) $attribute->getAttributeId(), 'attr...
[ "private", "function", "getFilterableAttributeList", "(", "$", "currentCategory", ")", "{", "$", "attributesList", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "getAttributes", "(", "$", "currentCategory", ")", "as", "$", "attribute", ")", "{", "$"...
Retrieve facet configuration for current category. Compute the intersection between existing data for the category, and all attributes set as filterable. @param CategoryInterface $currentCategory Current Category @return array
[ "Retrieve", "facet", "configuration", "for", "current", "category", ".", "Compute", "the", "intersection", "between", "existing", "data", "for", "the", "category", "and", "all", "attributes", "set", "as", "filterable", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php#L137-L159
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php
DataProviderPlugin.getDefaultStoreId
private function getDefaultStoreId() { $store = $this->storeManager->getDefaultStoreView(); if (null === $store) { // Occurs when current user does not have access to default website (due to AdminGWS ACLS on Magento EE). $store = !empty($this->storeManager->getWebsites()) ? ...
php
private function getDefaultStoreId() { $store = $this->storeManager->getDefaultStoreView(); if (null === $store) { // Occurs when current user does not have access to default website (due to AdminGWS ACLS on Magento EE). $store = !empty($this->storeManager->getWebsites()) ? ...
[ "private", "function", "getDefaultStoreId", "(", ")", "{", "$", "store", "=", "$", "this", "->", "storeManager", "->", "getDefaultStoreView", "(", ")", ";", "if", "(", "null", "===", "$", "store", ")", "{", "// Occurs when current user does not have access to defa...
Retrieve default store view id. @return int
[ "Retrieve", "default", "store", "view", "id", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php#L166-L176
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php
DataProviderPlugin.getAttributes
private function getAttributes($category) { $collection = $this->attributeCollectionFactory->create(['category' => $category]); $collection ->setCategory($category) ->addIsFilterableFilter() ->addStoreLabel($category->getStoreId()) ->setOrder('position...
php
private function getAttributes($category) { $collection = $this->attributeCollectionFactory->create(['category' => $category]); $collection ->setCategory($category) ->addIsFilterableFilter() ->addStoreLabel($category->getStoreId()) ->setOrder('position...
[ "private", "function", "getAttributes", "(", "$", "category", ")", "{", "$", "collection", "=", "$", "this", "->", "attributeCollectionFactory", "->", "create", "(", "[", "'category'", "=>", "$", "category", "]", ")", ";", "$", "collection", "->", "setCatego...
Retrieve attribute collection pre-filtered with only filterable attributes. @param CategoryInterface $category Category @return \Magento\Catalog\Api\Data\ProductAttributeInterface[]
[ "Retrieve", "attribute", "collection", "pre", "-", "filtered", "with", "only", "filterable", "attributes", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php#L220-L249
Smile-SA/elasticsuite
src/module-elasticsuite-core/Setup/ConfigOptionsList.php
ConfigOptionsList.getOptions
public function getOptions() { return [ new TextConfigOption( self::INPUT_KEY_ES_HOSTS, TextConfigOption::FRONTEND_WIZARD_TEXT, self::CONFIG_PATH_ES_HOSTS, 'ElasticSearch Servers List.' ), new SelectConfigOpt...
php
public function getOptions() { return [ new TextConfigOption( self::INPUT_KEY_ES_HOSTS, TextConfigOption::FRONTEND_WIZARD_TEXT, self::CONFIG_PATH_ES_HOSTS, 'ElasticSearch Servers List.' ), new SelectConfigOpt...
[ "public", "function", "getOptions", "(", ")", "{", "return", "[", "new", "TextConfigOption", "(", "self", "::", "INPUT_KEY_ES_HOSTS", ",", "TextConfigOption", "::", "FRONTEND_WIZARD_TEXT", ",", "self", "::", "CONFIG_PATH_ES_HOSTS", ",", "'ElasticSearch Servers List.'", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Setup/ConfigOptionsList.php#L71-L101
Smile-SA/elasticsuite
src/module-elasticsuite-core/Setup/ConfigOptionsList.php
ConfigOptionsList.createConfig
public function createConfig(array $options, DeploymentConfig $deploymentConfig) { $configData = new ConfigData(ConfigFilePool::APP_ENV); $clientOptions = $this->getClientOptions($options, $deploymentConfig); foreach ($clientOptions as $optionName => $value) { $configData->set(s...
php
public function createConfig(array $options, DeploymentConfig $deploymentConfig) { $configData = new ConfigData(ConfigFilePool::APP_ENV); $clientOptions = $this->getClientOptions($options, $deploymentConfig); foreach ($clientOptions as $optionName => $value) { $configData->set(s...
[ "public", "function", "createConfig", "(", "array", "$", "options", ",", "DeploymentConfig", "$", "deploymentConfig", ")", "{", "$", "configData", "=", "new", "ConfigData", "(", "ConfigFilePool", "::", "APP_ENV", ")", ";", "$", "clientOptions", "=", "$", "this...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Setup/ConfigOptionsList.php#L106-L116
Smile-SA/elasticsuite
src/module-elasticsuite-core/Setup/ConfigOptionsList.php
ConfigOptionsList.validate
public function validate(array $options, DeploymentConfig $deploymentConfig) { $errors = []; try { $options = array_filter($this->getClientOptions($options, $deploymentConfig)); $this->clientBuilder->build($options)->info(); } catch (\Exception $e) { $err...
php
public function validate(array $options, DeploymentConfig $deploymentConfig) { $errors = []; try { $options = array_filter($this->getClientOptions($options, $deploymentConfig)); $this->clientBuilder->build($options)->info(); } catch (\Exception $e) { $err...
[ "public", "function", "validate", "(", "array", "$", "options", ",", "DeploymentConfig", "$", "deploymentConfig", ")", "{", "$", "errors", "=", "[", "]", ";", "try", "{", "$", "options", "=", "array_filter", "(", "$", "this", "->", "getClientOptions", "(",...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Setup/ConfigOptionsList.php#L121-L133
Smile-SA/elasticsuite
src/module-elasticsuite-core/Setup/ConfigOptionsList.php
ConfigOptionsList.getClientOptions
private function getClientOptions(array $options, DeploymentConfig $deploymentConfig) { $clientOptions = []; if (isset($options[self::INPUT_KEY_ES_HOSTS]) || $deploymentConfig->get(self::CONFIG_PATH_ES_HOSTS)) { $clientOptions = [ 'servers' => $this->readConfig...
php
private function getClientOptions(array $options, DeploymentConfig $deploymentConfig) { $clientOptions = []; if (isset($options[self::INPUT_KEY_ES_HOSTS]) || $deploymentConfig->get(self::CONFIG_PATH_ES_HOSTS)) { $clientOptions = [ 'servers' => $this->readConfig...
[ "private", "function", "getClientOptions", "(", "array", "$", "options", ",", "DeploymentConfig", "$", "deploymentConfig", ")", "{", "$", "clientOptions", "=", "[", "]", ";", "if", "(", "isset", "(", "$", "options", "[", "self", "::", "INPUT_KEY_ES_HOSTS", "...
Read client options from CLI / env file. @param array $options Input options. @param DeploymentConfig $deploymentConfig Deployment config. @return array
[ "Read", "client", "options", "from", "CLI", "/", "env", "file", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Setup/ConfigOptionsList.php#L143-L159
Smile-SA/elasticsuite
src/module-elasticsuite-core/Setup/ConfigOptionsList.php
ConfigOptionsList.readConfiguration
private function readConfiguration(array $options, DeploymentConfig $deploymentConfig, $inputKey) { $config = null; $option = $this->getOption($inputKey); if ($option) { $configPath = $option->getConfigPath($inputKey); $config = $options[$inputKey] ?? ($configPath !=...
php
private function readConfiguration(array $options, DeploymentConfig $deploymentConfig, $inputKey) { $config = null; $option = $this->getOption($inputKey); if ($option) { $configPath = $option->getConfigPath($inputKey); $config = $options[$inputKey] ?? ($configPath !=...
[ "private", "function", "readConfiguration", "(", "array", "$", "options", ",", "DeploymentConfig", "$", "deploymentConfig", ",", "$", "inputKey", ")", "{", "$", "config", "=", "null", ";", "$", "option", "=", "$", "this", "->", "getOption", "(", "$", "inpu...
Read a value from the input with fallback to the current deployment config. @param array $options Input options. @param DeploymentConfig $deploymentConfig Deployment config. @param string $inputKey Name of the variable in the input options. @return mixed
[ "Read", "a", "value", "from", "the", "input", "with", "fallback", "to", "the", "current", "deployment", "config", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Setup/ConfigOptionsList.php#L170-L181
Smile-SA/elasticsuite
src/module-elasticsuite-core/Setup/ConfigOptionsList.php
ConfigOptionsList.getOption
private function getOption($inputKey) { $option = null; foreach ($this->getOptions() as $currentOption) { $option = $currentOption->getName() == $inputKey ? $currentOption : $option; } return $option; }
php
private function getOption($inputKey) { $option = null; foreach ($this->getOptions() as $currentOption) { $option = $currentOption->getName() == $inputKey ? $currentOption : $option; } return $option; }
[ "private", "function", "getOption", "(", "$", "inputKey", ")", "{", "$", "option", "=", "null", ";", "foreach", "(", "$", "this", "->", "getOptions", "(", ")", "as", "$", "currentOption", ")", "{", "$", "option", "=", "$", "currentOption", "->", "getNa...
Retrieve option by input key. @param string $inputKey Input key. @return \Magento\Framework\Setup\Option\AbstractConfigOption|null
[ "Retrieve", "option", "by", "input", "key", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Setup/ConfigOptionsList.php#L190-L199
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder.php
Builder.buildQuery
public function buildQuery(QueryInterface $query) { $searchQuery = false; $builder = $this->getBuilder($query); if ($builder !== null) { $searchQuery = $builder->buildQuery($query); } return $searchQuery; }
php
public function buildQuery(QueryInterface $query) { $searchQuery = false; $builder = $this->getBuilder($query); if ($builder !== null) { $searchQuery = $builder->buildQuery($query); } return $searchQuery; }
[ "public", "function", "buildQuery", "(", "QueryInterface", "$", "query", ")", "{", "$", "searchQuery", "=", "false", ";", "$", "builder", "=", "$", "this", "->", "getBuilder", "(", "$", "query", ")", ";", "if", "(", "$", "builder", "!==", "null", ")", ...
Build the ES query from a Query @param QueryInterface $query Query to be built. @return array
[ "Build", "the", "ES", "query", "from", "a", "Query" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder.php#L50-L60
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder.php
Builder.getBuilder
private function getBuilder($query) { $queryType = $query->getType(); if (!isset($this->builders[$queryType])) { throw new \InvalidArgumentException("Unknow query builder for {$queryType}."); } return $this->builders[$queryType]; }
php
private function getBuilder($query) { $queryType = $query->getType(); if (!isset($this->builders[$queryType])) { throw new \InvalidArgumentException("Unknow query builder for {$queryType}."); } return $this->builders[$queryType]; }
[ "private", "function", "getBuilder", "(", "$", "query", ")", "{", "$", "queryType", "=", "$", "query", "->", "getType", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "this", "->", "builders", "[", "$", "queryType", "]", ")", ")", "{", "throw", ...
Retrieve the builder used to build a query. @param QueryInterface $query Query to be built. @return BuilderInterface
[ "Retrieve", "the", "builder", "used", "to", "build", "a", "query", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder.php#L69-L78
Smile-SA/elasticsuite
src/module-elasticsuite-virtual-category/Model/Rule/Condition/Product/CategoryNestedFilter.php
CategoryNestedFilter.getFilter
public function getFilter() { $filterParams = ['field' => self::FILTER_FIELD, 'value' => true]; $filterQuery = $this->queryFactory->create( QueryInterface::TYPE_NOT, ['query' => $this->queryFactory->create(QueryInterface::TYPE_TERM, $filterParams)] ); return...
php
public function getFilter() { $filterParams = ['field' => self::FILTER_FIELD, 'value' => true]; $filterQuery = $this->queryFactory->create( QueryInterface::TYPE_NOT, ['query' => $this->queryFactory->create(QueryInterface::TYPE_TERM, $filterParams)] ); return...
[ "public", "function", "getFilter", "(", ")", "{", "$", "filterParams", "=", "[", "'field'", "=>", "self", "::", "FILTER_FIELD", ",", "'value'", "=>", "true", "]", ";", "$", "filterQuery", "=", "$", "this", "->", "queryFactory", "->", "create", "(", "Quer...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Rule/Condition/Product/CategoryNestedFilter.php#L51-L60
Smile-SA/elasticsuite
src/module-elasticsuite-swatches/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php
FrontPlugin.afterSetForm
public function afterSetForm(\Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front $subject) { if ($this->getAttribute() && $this->swatchHelper->isSwatchAttribute($this->getAttribute())) { if ($subject->getForm() && $subject->getForm()->getElement('facet_max_size')) { ...
php
public function afterSetForm(\Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front $subject) { if ($this->getAttribute() && $this->swatchHelper->isSwatchAttribute($this->getAttribute())) { if ($subject->getForm() && $subject->getForm()->getElement('facet_max_size')) { ...
[ "public", "function", "afterSetForm", "(", "\\", "Magento", "\\", "Catalog", "\\", "Block", "\\", "Adminhtml", "\\", "Product", "\\", "Attribute", "\\", "Edit", "\\", "Tab", "\\", "Front", "$", "subject", ")", "{", "if", "(", "$", "this", "->", "getAttri...
Disable facet_max_size field for swatches attributes. @param \Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front $subject The StoreFront tab @return \Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front
[ "Disable", "facet_max_size", "field", "for", "swatches", "attributes", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-swatches/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php#L59-L68
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Controller/Navigation/Filter/Ajax.php
Ajax.execute
public function execute() { $this->initLayer(); $items = $this->getItems(); $result = $this->jsonResultFactory->create()->setData($items); return $result; }
php
public function execute() { $this->initLayer(); $items = $this->getItems(); $result = $this->jsonResultFactory->create()->setData($items); return $result; }
[ "public", "function", "execute", "(", ")", "{", "$", "this", "->", "initLayer", "(", ")", ";", "$", "items", "=", "$", "this", "->", "getItems", "(", ")", ";", "$", "result", "=", "$", "this", "->", "jsonResultFactory", "->", "create", "(", ")", "-...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Controller/Navigation/Filter/Ajax.php#L77-L85
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Controller/Navigation/Filter/Ajax.php
Ajax.getLayerType
private function getLayerType() { $layerType = Resolver::CATALOG_LAYER_CATEGORY; if ($this->isSearch()) { $layerType = Resolver::CATALOG_LAYER_SEARCH; } return $layerType; }
php
private function getLayerType() { $layerType = Resolver::CATALOG_LAYER_CATEGORY; if ($this->isSearch()) { $layerType = Resolver::CATALOG_LAYER_SEARCH; } return $layerType; }
[ "private", "function", "getLayerType", "(", ")", "{", "$", "layerType", "=", "Resolver", "::", "CATALOG_LAYER_CATEGORY", ";", "if", "(", "$", "this", "->", "isSearch", "(", ")", ")", "{", "$", "layerType", "=", "Resolver", "::", "CATALOG_LAYER_SEARCH", ";", ...
Current navigation layer type (search or category). @return string
[ "Current", "navigation", "layer", "type", "(", "search", "or", "category", ")", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Controller/Navigation/Filter/Ajax.php#L92-L101
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Controller/Navigation/Filter/Ajax.php
Ajax.initLayer
private function initLayer() { $this->layerResolver->create($this->getLayerType()); if ($this->getRequest()->getParam('cat')) { $category = $this->categoryFactory->create()->setId($this->getRequest()->getParam('cat')); $this->layerResolver->get()->setCurrentCategory($categor...
php
private function initLayer() { $this->layerResolver->create($this->getLayerType()); if ($this->getRequest()->getParam('cat')) { $category = $this->categoryFactory->create()->setId($this->getRequest()->getParam('cat')); $this->layerResolver->get()->setCurrentCategory($categor...
[ "private", "function", "initLayer", "(", ")", "{", "$", "this", "->", "layerResolver", "->", "create", "(", "$", "this", "->", "getLayerType", "(", ")", ")", ";", "if", "(", "$", "this", "->", "getRequest", "(", ")", "->", "getParam", "(", "'cat'", "...
Init the current navigation layer. @return \Smile\ElasticsuiteCatalog\Controller\Navigation\Filter\Ajax
[ "Init", "the", "current", "navigation", "layer", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Controller/Navigation/Filter/Ajax.php#L108-L120
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Controller/Navigation/Filter/Ajax.php
Ajax.applyFilters
private function applyFilters() { $layer = $this->layerResolver->get(); $filterList = $this->getFilterList(); foreach ($filterList->getFilters($layer) as $filter) { $filter->apply($this->getRequest()); } $layer->apply(); return $this; }
php
private function applyFilters() { $layer = $this->layerResolver->get(); $filterList = $this->getFilterList(); foreach ($filterList->getFilters($layer) as $filter) { $filter->apply($this->getRequest()); } $layer->apply(); return $this; }
[ "private", "function", "applyFilters", "(", ")", "{", "$", "layer", "=", "$", "this", "->", "layerResolver", "->", "get", "(", ")", ";", "$", "filterList", "=", "$", "this", "->", "getFilterList", "(", ")", ";", "foreach", "(", "$", "filterList", "->",...
Apply current filters to the layer product collection. @return \Smile\ElasticsuiteCatalog\Controller\Navigation\Filter\Ajax
[ "Apply", "current", "filters", "to", "the", "layer", "product", "collection", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Controller/Navigation/Filter/Ajax.php#L137-L149
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Controller/Navigation/Filter/Ajax.php
Ajax.getItems
private function getItems() { $items = []; $layer = $this->layerResolver->get(); $filterList = $this->getFilterList(); foreach ($filterList->getFilters($layer) as $filter) { if ($filter->getRequestVar() == $this->getFilterName()) { foreach ($filter->getI...
php
private function getItems() { $items = []; $layer = $this->layerResolver->get(); $filterList = $this->getFilterList(); foreach ($filterList->getFilters($layer) as $filter) { if ($filter->getRequestVar() == $this->getFilterName()) { foreach ($filter->getI...
[ "private", "function", "getItems", "(", ")", "{", "$", "items", "=", "[", "]", ";", "$", "layer", "=", "$", "this", "->", "layerResolver", "->", "get", "(", ")", ";", "$", "filterList", "=", "$", "this", "->", "getFilterList", "(", ")", ";", "forea...
Returns array of items loaded through ajax. @return array
[ "Returns", "array", "of", "items", "loaded", "through", "ajax", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Controller/Navigation/Filter/Ajax.php#L156-L173
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Block/Navigation.php
Navigation.canShowBlock
public function canShowBlock() { $canShowBlock = parent::canShowBlock(); if ($this->moduleManager->isEnabled('Magento_Staging')) { try { $versionManager = $this->objectManager->get('\Magento\Staging\Model\VersionManager'); $canShowBlock = $canShowBlock &...
php
public function canShowBlock() { $canShowBlock = parent::canShowBlock(); if ($this->moduleManager->isEnabled('Magento_Staging')) { try { $versionManager = $this->objectManager->get('\Magento\Staging\Model\VersionManager'); $canShowBlock = $canShowBlock &...
[ "public", "function", "canShowBlock", "(", ")", "{", "$", "canShowBlock", "=", "parent", "::", "canShowBlock", "(", ")", ";", "if", "(", "$", "this", "->", "moduleManager", "->", "isEnabled", "(", "'Magento_Staging'", ")", ")", "{", "try", "{", "$", "ver...
Check if we can show this block. According to @see \Magento\LayeredNavigationStaging\Block\Navigation::canShowBlock We should not show the block if staging is enabled and if we are currently previewing the results. @return bool
[ "Check", "if", "we", "can", "show", "this", "block", ".", "According", "to", "@see", "\\", "Magento", "\\", "LayeredNavigationStaging", "\\", "Block", "\\", "Navigation", "::", "canShowBlock", "We", "should", "not", "show", "the", "block", "if", "staging", "...
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation.php#L81-L101
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Block/Navigation.php
Navigation.getActiveFilters
public function getActiveFilters() { $activeFilters = []; if (!$this->isInline()) { $requestParams = array_keys($this->getRequest()->getParams()); $displayedFilters = $this->getDisplayedFilters(); $expandedFacets = $this->_scopeConfig->getValue(self::DEFAULT...
php
public function getActiveFilters() { $activeFilters = []; if (!$this->isInline()) { $requestParams = array_keys($this->getRequest()->getParams()); $displayedFilters = $this->getDisplayedFilters(); $expandedFacets = $this->_scopeConfig->getValue(self::DEFAULT...
[ "public", "function", "getActiveFilters", "(", ")", "{", "$", "activeFilters", "=", "[", "]", ";", "if", "(", "!", "$", "this", "->", "isInline", "(", ")", ")", "{", "$", "requestParams", "=", "array_keys", "(", "$", "this", "->", "getRequest", "(", ...
Return index of the facets that are expanded for the current page : - nth first facets (depending of config) - facets with at least one selected filter @return string
[ "Return", "index", "of", "the", "facets", "that", "are", "expanded", "for", "the", "current", "page", ":" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation.php#L111-L129
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Block/Navigation.php
Navigation.getDisplayedFilters
public function getDisplayedFilters() { $displayedFilters = array_filter( $this->getFilters(), function ($filter) { return $filter->getItemsCount() > 0; } ); return array_values($displayedFilters); }
php
public function getDisplayedFilters() { $displayedFilters = array_filter( $this->getFilters(), function ($filter) { return $filter->getItemsCount() > 0; } ); return array_values($displayedFilters); }
[ "public", "function", "getDisplayedFilters", "(", ")", "{", "$", "displayedFilters", "=", "array_filter", "(", "$", "this", "->", "getFilters", "(", ")", ",", "function", "(", "$", "filter", ")", "{", "return", "$", "filter", "->", "getItemsCount", "(", ")...
Returns facet that are displayed. @return array
[ "Returns", "facet", "that", "are", "displayed", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation.php#L136-L146
Smile-SA/elasticsuite
src/module-elasticsuite-tracker/Block/Variables/Page/Search.php
Search.getVariables
public function getVariables() { $variables = ['search.query' => $this->catalogSearchData->getEscapedQueryText()]; if ($layer = $this->catalogLayer) { $productCollection = $layer->getProductCollection(); $variables['search.is_spellchecked'] = (int) $productCollection->isSpel...
php
public function getVariables() { $variables = ['search.query' => $this->catalogSearchData->getEscapedQueryText()]; if ($layer = $this->catalogLayer) { $productCollection = $layer->getProductCollection(); $variables['search.is_spellchecked'] = (int) $productCollection->isSpel...
[ "public", "function", "getVariables", "(", ")", "{", "$", "variables", "=", "[", "'search.query'", "=>", "$", "this", "->", "catalogSearchData", "->", "getEscapedQueryText", "(", ")", "]", ";", "if", "(", "$", "layer", "=", "$", "this", "->", "catalogLayer...
Append the user fulltext query to the tracked variables list @return array
[ "Append", "the", "user", "fulltext", "query", "to", "the", "tracked", "variables", "list" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Block/Variables/Page/Search.php#L71-L81
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Plugin/Search/QueryFactoryPlugin.php
QueryFactoryPlugin.afterGet
public function afterGet(\Magento\Search\Model\QueryFactory $queryFactory, \Magento\Search\Model\Query $query) { if ($query && $query->getQueryText() !== '') { $this->searchContext->setCurrentSearchQuery($query); } return $query; }
php
public function afterGet(\Magento\Search\Model\QueryFactory $queryFactory, \Magento\Search\Model\Query $query) { if ($query && $query->getQueryText() !== '') { $this->searchContext->setCurrentSearchQuery($query); } return $query; }
[ "public", "function", "afterGet", "(", "\\", "Magento", "\\", "Search", "\\", "Model", "\\", "QueryFactory", "$", "queryFactory", ",", "\\", "Magento", "\\", "Search", "\\", "Model", "\\", "Query", "$", "query", ")", "{", "if", "(", "$", "query", "&&", ...
Set the current search query into the Search context after being retrieved. @SuppressWarnings(PHPMD.UnusedFormalParameter) @param \Magento\Search\Model\QueryFactory $queryFactory The Query Factory @param \Magento\Search\Model\Query $query The Query @return \Magento\Search\Model\Query
[ "Set", "the", "current", "search", "query", "into", "the", "Search", "context", "after", "being", "retrieved", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Search/QueryFactoryPlugin.php#L51-L58
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/Builder.php
Builder.create
public function create( $storeId, $containerName, $from, $size, $query = null, $sortOrders = [], $filters = [], $queryFilters = [], $facets = [] ) { $containerConfig = $this->getRequestContainerConfiguration($storeId, $containerName); ...
php
public function create( $storeId, $containerName, $from, $size, $query = null, $sortOrders = [], $filters = [], $queryFilters = [], $facets = [] ) { $containerConfig = $this->getRequestContainerConfiguration($storeId, $containerName); ...
[ "public", "function", "create", "(", "$", "storeId", ",", "$", "containerName", ",", "$", "from", ",", "$", "size", ",", "$", "query", "=", "null", ",", "$", "sortOrders", "=", "[", "]", ",", "$", "filters", "=", "[", "]", ",", "$", "queryFilters",...
Create a new search request. @param integer $storeId Search request store id. @param string $containerName Search request name. @param integer $from Search request pagination from clause. @param integer $size Search request pagination siz...
[ "Create", "a", "new", "search", "request", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Builder.php#L134-L179
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/Builder.php
Builder.getContainerAggregations
private function getContainerAggregations(ContainerConfigurationInterface $containerConfig, $query, $filters, $queryFilters) { return $this->aggregationResolver->getContainerAggregations($containerConfig, $query, $filters, $queryFilters); }
php
private function getContainerAggregations(ContainerConfigurationInterface $containerConfig, $query, $filters, $queryFilters) { return $this->aggregationResolver->getContainerAggregations($containerConfig, $query, $filters, $queryFilters); }
[ "private", "function", "getContainerAggregations", "(", "ContainerConfigurationInterface", "$", "containerConfig", ",", "$", "query", ",", "$", "filters", ",", "$", "queryFilters", ")", "{", "return", "$", "this", "->", "aggregationResolver", "->", "getContainerAggreg...
Returns aggregations configured in the search container. @param ContainerConfigurationInterface $containerConfig Search request configuration. @param string|QueryInterface $query Search Query. @param array $filters Search request filters. @param QueryInterface[] ...
[ "Returns", "aggregations", "configured", "in", "the", "search", "container", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Builder.php#L203-L206
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/Builder.php
Builder.getSpellingType
private function getSpellingType(ContainerConfigurationInterface $containerConfig, $queryText) { if (is_array($queryText)) { $queryText = implode(" ", $queryText); } $spellcheckRequestParams = [ 'index' => $containerConfig->getIndexName(), 'type...
php
private function getSpellingType(ContainerConfigurationInterface $containerConfig, $queryText) { if (is_array($queryText)) { $queryText = implode(" ", $queryText); } $spellcheckRequestParams = [ 'index' => $containerConfig->getIndexName(), 'type...
[ "private", "function", "getSpellingType", "(", "ContainerConfigurationInterface", "$", "containerConfig", ",", "$", "queryText", ")", "{", "if", "(", "is_array", "(", "$", "queryText", ")", ")", "{", "$", "queryText", "=", "implode", "(", "\" \"", ",", "$", ...
Retireve the spelling type for a fulltext query. @param ContainerConfigurationInterface $containerConfig Search request configuration. @param string|string[] $queryText Query text. @return int
[ "Retireve", "the", "spelling", "type", "for", "a", "fulltext", "query", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Builder.php#L216-L233
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/Builder.php
Builder.getRequestContainerConfiguration
private function getRequestContainerConfiguration($storeId, $containerName) { if ($containerName === null) { throw new \LogicException('Request name is not set'); } $config = $this->containerConfigFactory->create( ['containerName' => $containerName, 'storeId' => $sto...
php
private function getRequestContainerConfiguration($storeId, $containerName) { if ($containerName === null) { throw new \LogicException('Request name is not set'); } $config = $this->containerConfigFactory->create( ['containerName' => $containerName, 'storeId' => $sto...
[ "private", "function", "getRequestContainerConfiguration", "(", "$", "storeId", ",", "$", "containerName", ")", "{", "if", "(", "$", "containerName", "===", "null", ")", "{", "throw", "new", "\\", "LogicException", "(", "'Request name is not set'", ")", ";", "}"...
Load the search request configuration (index, type, mapping, ...) using the search request container name. @throws \LogicException Thrown when the search container is not found into the configuration. @param integer $storeId Store id. @param string $containerName Search request container name. @return Contain...
[ "Load", "the", "search", "request", "configuration", "(", "index", "type", "mapping", "...", ")", "using", "the", "search", "request", "container", "name", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Builder.php#L245-L260
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/SortOrder/Builder.php
Builder.buildSortOrder
private function buildSortOrder(SortOrderInterface $sortOrder) { $sortField = $sortOrder->getField(); $sortOrderConfig = ['order' => $sortOrder->getDirection()]; if ($sortField !== SortOrderInterface::DEFAULT_SORT_FIELD) { $sortOrderConfig['missing'] = $sortOrder->getMiss...
php
private function buildSortOrder(SortOrderInterface $sortOrder) { $sortField = $sortOrder->getField(); $sortOrderConfig = ['order' => $sortOrder->getDirection()]; if ($sortField !== SortOrderInterface::DEFAULT_SORT_FIELD) { $sortOrderConfig['missing'] = $sortOrder->getMiss...
[ "private", "function", "buildSortOrder", "(", "SortOrderInterface", "$", "sortOrder", ")", "{", "$", "sortField", "=", "$", "sortOrder", "->", "getField", "(", ")", ";", "$", "sortOrderConfig", "=", "[", "'order'", "=>", "$", "sortOrder", "->", "getDirection",...
Build a sort order ES condition from a SortOrderInterface specification. @SuppressWarnings(PHPMD.UnusedPrivateMethod) @param SortOrderInterface $sortOrder Request sort order specification object. @return array
[ "Build", "a", "sort", "order", "ES", "condition", "from", "a", "SortOrderInterface", "specification", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/SortOrder/Builder.php#L66-L87
Smile-SA/elasticsuite
src/module-elasticsuite-tracker/Helper/Data.php
Data.getCookieConfig
public function getCookieConfig() { $config = $this->scopeConfig->getValue(self::CONFIG_COOKIE); $config['domain'] = $this->sessionManager->getCookieDomain(); $config['path'] = $this->sessionManager->getCookiePath(); return $config; }
php
public function getCookieConfig() { $config = $this->scopeConfig->getValue(self::CONFIG_COOKIE); $config['domain'] = $this->sessionManager->getCookieDomain(); $config['path'] = $this->sessionManager->getCookiePath(); return $config; }
[ "public", "function", "getCookieConfig", "(", ")", "{", "$", "config", "=", "$", "this", "->", "scopeConfig", "->", "getValue", "(", "self", "::", "CONFIG_COOKIE", ")", ";", "$", "config", "[", "'domain'", "]", "=", "$", "this", "->", "sessionManager", "...
Return an array containing the cookie configuration @return array
[ "Return", "an", "array", "containing", "the", "cookie", "configuration" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Helper/Data.php#L122-L129
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Autocomplete/Category/DataProvider.php
DataProvider.getItems
public function getItems() { $result = []; if ($this->configurationHelper->isEnabled($this->getType())) { $categoryCollection = $this->getCategoryCollection(); if ($categoryCollection) { foreach ($categoryCollection as $category) { if ($ca...
php
public function getItems() { $result = []; if ($this->configurationHelper->isEnabled($this->getType())) { $categoryCollection = $this->getCategoryCollection(); if ($categoryCollection) { foreach ($categoryCollection as $category) { if ($ca...
[ "public", "function", "getItems", "(", ")", "{", "$", "result", "=", "[", "]", ";", "if", "(", "$", "this", "->", "configurationHelper", "->", "isEnabled", "(", "$", "this", "->", "getType", "(", ")", ")", ")", "{", "$", "categoryCollection", "=", "$...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Category/DataProvider.php#L107-L125
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Autocomplete/Category/DataProvider.php
DataProvider.getSuggestedTerms
private function getSuggestedTerms() { $terms = array_map( function (\Magento\Search\Model\Autocomplete\Item $termItem) { return $termItem->getTitle(); }, $this->termDataProvider->getItems() ); return $terms; }
php
private function getSuggestedTerms() { $terms = array_map( function (\Magento\Search\Model\Autocomplete\Item $termItem) { return $termItem->getTitle(); }, $this->termDataProvider->getItems() ); return $terms; }
[ "private", "function", "getSuggestedTerms", "(", ")", "{", "$", "terms", "=", "array_map", "(", "function", "(", "\\", "Magento", "\\", "Search", "\\", "Model", "\\", "Autocomplete", "\\", "Item", "$", "termItem", ")", "{", "return", "$", "termItem", "->",...
List of search terms suggested by the search terms data provider. @return array
[ "List", "of", "search", "terms", "suggested", "by", "the", "search", "terms", "data", "provider", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Category/DataProvider.php#L132-L142
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Autocomplete/Category/DataProvider.php
DataProvider.getCategoryCollection
private function getCategoryCollection() { $categoryCollection = null; $suggestedTerms = $this->getSuggestedTerms(); $terms = [$this->queryFactory->get()->getQueryText()]; if (!empty($suggestedTerms)) { $terms = array_merge($terms, $suggestedTerms); } ...
php
private function getCategoryCollection() { $categoryCollection = null; $suggestedTerms = $this->getSuggestedTerms(); $terms = [$this->queryFactory->get()->getQueryText()]; if (!empty($suggestedTerms)) { $terms = array_merge($terms, $suggestedTerms); } ...
[ "private", "function", "getCategoryCollection", "(", ")", "{", "$", "categoryCollection", "=", "null", ";", "$", "suggestedTerms", "=", "$", "this", "->", "getSuggestedTerms", "(", ")", ";", "$", "terms", "=", "[", "$", "this", "->", "queryFactory", "->", ...
Suggested categories collection. Returns null if no suggested search terms. @return \Smile\ElasticsuiteCatalog\Model\ResourceModel\Category\Fulltext\Collection|null
[ "Suggested", "categories", "collection", ".", "Returns", "null", "if", "no", "suggested", "search", "terms", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Category/DataProvider.php#L150-L167
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Context.php
Context.setCurrentCategory
public function setCurrentCategory(\Magento\Catalog\Api\Data\CategoryInterface $category) { if ($this->category !== null && ((int) $this->category->getId() === (int) $category->getId())) { return $this; } $this->category = $category; return $this; }
php
public function setCurrentCategory(\Magento\Catalog\Api\Data\CategoryInterface $category) { if ($this->category !== null && ((int) $this->category->getId() === (int) $category->getId())) { return $this; } $this->category = $category; return $this; }
[ "public", "function", "setCurrentCategory", "(", "\\", "Magento", "\\", "Catalog", "\\", "Api", "\\", "Data", "\\", "CategoryInterface", "$", "category", ")", "{", "if", "(", "$", "this", "->", "category", "!==", "null", "&&", "(", "(", "int", ")", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Context.php#L65-L74
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Context.php
Context.setCurrentSearchQuery
public function setCurrentSearchQuery(\Magento\Search\Model\QueryInterface $query) { if ($this->searchQuery !== null && ($this->searchQuery->getQueryText() === $query->getQueryText())) { return $this; } $this->searchQuery = $query; return $this; }
php
public function setCurrentSearchQuery(\Magento\Search\Model\QueryInterface $query) { if ($this->searchQuery !== null && ($this->searchQuery->getQueryText() === $query->getQueryText())) { return $this; } $this->searchQuery = $query; return $this; }
[ "public", "function", "setCurrentSearchQuery", "(", "\\", "Magento", "\\", "Search", "\\", "Model", "\\", "QueryInterface", "$", "query", ")", "{", "if", "(", "$", "this", "->", "searchQuery", "!==", "null", "&&", "(", "$", "this", "->", "searchQuery", "->...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Context.php#L79-L88
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Context.php
Context.getStoreId
public function getStoreId() { if ($this->storeId === null) { $this->storeId = $this->storeManager->getStore()->getId(); } return $this->storeId; }
php
public function getStoreId() { if ($this->storeId === null) { $this->storeId = $this->storeManager->getStore()->getId(); } return $this->storeId; }
[ "public", "function", "getStoreId", "(", ")", "{", "if", "(", "$", "this", "->", "storeId", "===", "null", ")", "{", "$", "this", "->", "storeId", "=", "$", "this", "->", "storeManager", "->", "getStore", "(", ")", "->", "getId", "(", ")", ";", "}"...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Context.php#L129-L136
Smile-SA/elasticsuite
src/module-elasticsuite-tracker/Model/ResourceModel/CustomerLink.php
CustomerLink.saveLink
public function saveLink($linkData) { $connection = $this->getConnection(); if (isset($linkData['delete_after']) && ($linkData['delete_after'] instanceof \DateTime)) { $linkData['delete_after'] = $this->formatDate($linkData['delete_after']); } $connection->insertOnDupli...
php
public function saveLink($linkData) { $connection = $this->getConnection(); if (isset($linkData['delete_after']) && ($linkData['delete_after'] instanceof \DateTime)) { $linkData['delete_after'] = $this->formatDate($linkData['delete_after']); } $connection->insertOnDupli...
[ "public", "function", "saveLink", "(", "$", "linkData", ")", "{", "$", "connection", "=", "$", "this", "->", "getConnection", "(", ")", ";", "if", "(", "isset", "(", "$", "linkData", "[", "'delete_after'", "]", ")", "&&", "(", "$", "linkData", "[", "...
Save customer link. @param array $linkData array containing visitor_id, session_id, customer_id and delete_after.
[ "Save", "customer", "link", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/ResourceModel/CustomerLink.php#L31-L44
Smile-SA/elasticsuite
src/module-elasticsuite-tracker/Model/ResourceModel/CustomerLink.php
CustomerLink.deleteByCustomerId
public function deleteByCustomerId($customerId) { $connection = $this->getConnection(); $connection->delete($this->getMainTable(), $connection->quoteInto('customer_id = ?', $customerId)); }
php
public function deleteByCustomerId($customerId) { $connection = $this->getConnection(); $connection->delete($this->getMainTable(), $connection->quoteInto('customer_id = ?', $customerId)); }
[ "public", "function", "deleteByCustomerId", "(", "$", "customerId", ")", "{", "$", "connection", "=", "$", "this", "->", "getConnection", "(", ")", ";", "$", "connection", "->", "delete", "(", "$", "this", "->", "getMainTable", "(", ")", ",", "$", "conne...
Delete all link data for a given customer id. @param int $customerId the customer Id
[ "Delete", "all", "link", "data", "for", "a", "given", "customer", "id", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/ResourceModel/CustomerLink.php#L51-L55
Smile-SA/elasticsuite
src/module-elasticsuite-tracker/Model/ResourceModel/CustomerLink.php
CustomerLink.deleteByDeleteAfter
public function deleteByDeleteAfter(\DateTime $dateTime) { $connection = $this->getConnection(); $deleteAfter = $this->formatDate($dateTime); $connection->delete($this->getMainTable(), $connection->quoteInto('delete_after <= ?', $deleteAfter)); }
php
public function deleteByDeleteAfter(\DateTime $dateTime) { $connection = $this->getConnection(); $deleteAfter = $this->formatDate($dateTime); $connection->delete($this->getMainTable(), $connection->quoteInto('delete_after <= ?', $deleteAfter)); }
[ "public", "function", "deleteByDeleteAfter", "(", "\\", "DateTime", "$", "dateTime", ")", "{", "$", "connection", "=", "$", "this", "->", "getConnection", "(", ")", ";", "$", "deleteAfter", "=", "$", "this", "->", "formatDate", "(", "$", "dateTime", ")", ...
Delete all link data that are having a "delete_after" column which is lteq than the one passed in parameter. @param \DateTime $dateTime The date
[ "Delete", "all", "link", "data", "that", "are", "having", "a", "delete_after", "column", "which", "is", "lteq", "than", "the", "one", "passed", "in", "parameter", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/ResourceModel/CustomerLink.php#L62-L67
Smile-SA/elasticsuite
src/module-elasticsuite-tracker/Model/ResourceModel/CustomerLink.php
CustomerLink.setDeleteAfter
public function setDeleteAfter(int $customerId, \DateTime $dateTime) { $connection = $this->getConnection(); $deleteAfter = $this->formatDate($dateTime); $connection->update( $this->getMainTable(), ['delete_after' => $deleteAfter], $connection->quoteInto(...
php
public function setDeleteAfter(int $customerId, \DateTime $dateTime) { $connection = $this->getConnection(); $deleteAfter = $this->formatDate($dateTime); $connection->update( $this->getMainTable(), ['delete_after' => $deleteAfter], $connection->quoteInto(...
[ "public", "function", "setDeleteAfter", "(", "int", "$", "customerId", ",", "\\", "DateTime", "$", "dateTime", ")", "{", "$", "connection", "=", "$", "this", "->", "getConnection", "(", ")", ";", "$", "deleteAfter", "=", "$", "this", "->", "formatDate", ...
Set the delete after field for a given customer Id. @param int $customerId The customer Id @param \DateTime $dateTime The date to set
[ "Set", "the", "delete", "after", "field", "for", "a", "given", "customer", "Id", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/ResourceModel/CustomerLink.php#L75-L84
Smile-SA/elasticsuite
src/module-elasticsuite-tracker/Model/ResourceModel/CustomerLink.php
CustomerLink.getVisitorIds
public function getVisitorIds($customerId) { $connection = $this->getConnection(); $select = $connection->select() ->from($this->getMainTable(), ['visitor_id']) ->where($connection->quoteInto('customer_id = ?', $customerId)); return array_unique($connection->fetchCo...
php
public function getVisitorIds($customerId) { $connection = $this->getConnection(); $select = $connection->select() ->from($this->getMainTable(), ['visitor_id']) ->where($connection->quoteInto('customer_id = ?', $customerId)); return array_unique($connection->fetchCo...
[ "public", "function", "getVisitorIds", "(", "$", "customerId", ")", "{", "$", "connection", "=", "$", "this", "->", "getConnection", "(", ")", ";", "$", "select", "=", "$", "connection", "->", "select", "(", ")", "->", "from", "(", "$", "this", "->", ...
Retrieve all visitor ids used by a given customer Id. @param int $customerId The customer Id @return array
[ "Retrieve", "all", "visitor", "ids", "used", "by", "a", "given", "customer", "Id", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/ResourceModel/CustomerLink.php#L93-L102
Smile-SA/elasticsuite
src/module-elasticsuite-tracker/Model/ResourceModel/CustomerLink.php
CustomerLink.formatDate
private function formatDate(\DateTime $dateTime) { return $dateTime->format(\Magento\Framework\DB\Adapter\Pdo\Mysql::DATE_FORMAT); }
php
private function formatDate(\DateTime $dateTime) { return $dateTime->format(\Magento\Framework\DB\Adapter\Pdo\Mysql::DATE_FORMAT); }
[ "private", "function", "formatDate", "(", "\\", "DateTime", "$", "dateTime", ")", "{", "return", "$", "dateTime", "->", "format", "(", "\\", "Magento", "\\", "Framework", "\\", "DB", "\\", "Adapter", "\\", "Pdo", "\\", "Mysql", "::", "DATE_FORMAT", ")", ...
Format a DateTime object to proper format for DB saving. @param \DateTime $dateTime Date time @return string
[ "Format", "a", "DateTime", "object", "to", "proper", "format", "for", "DB", "saving", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/ResourceModel/CustomerLink.php#L121-L124
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Category/FilterableAttribute/SaveHandler.php
SaveHandler.execute
public function execute($entity, $arguments = []) { if ($entity->getId() && $entity->getFacetConfig() && $entity->getFacetConfigOrder()) { $position = []; $data = $entity->getFacetConfig(); $sortOrder = $entity->getFacetConfigOrder(); foreach ($data as ...
php
public function execute($entity, $arguments = []) { if ($entity->getId() && $entity->getFacetConfig() && $entity->getFacetConfigOrder()) { $position = []; $data = $entity->getFacetConfig(); $sortOrder = $entity->getFacetConfigOrder(); foreach ($data as ...
[ "public", "function", "execute", "(", "$", "entity", ",", "$", "arguments", "=", "[", "]", ")", "{", "if", "(", "$", "entity", "->", "getId", "(", ")", "&&", "$", "entity", "->", "getFacetConfig", "(", ")", "&&", "$", "entity", "->", "getFacetConfigO...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Category/FilterableAttribute/SaveHandler.php#L45-L62
Smile-SA/elasticsuite
src/module-elasticsuite-core/Client/ClientBuilder.php
ClientBuilder.build
public function build($options = []) { $options = array_merge($this->defaultOptions, $options); $clientBuilder = $this->clientBuilder->create(); $hosts = $this->getHosts($options); if (!empty($hosts)) { $clientBuilder->setHosts($hosts); } if ($op...
php
public function build($options = []) { $options = array_merge($this->defaultOptions, $options); $clientBuilder = $this->clientBuilder->create(); $hosts = $this->getHosts($options); if (!empty($hosts)) { $clientBuilder->setHosts($hosts); } if ($op...
[ "public", "function", "build", "(", "$", "options", "=", "[", "]", ")", "{", "$", "options", "=", "array_merge", "(", "$", "this", "->", "defaultOptions", ",", "$", "options", ")", ";", "$", "clientBuilder", "=", "$", "this", "->", "clientBuilder", "->...
Build an ES client from options. @param array $options Client options. See self::defaultOptions for available options. @return \Elasticsearch\Client
[ "Build", "an", "ES", "client", "from", "options", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Client/ClientBuilder.php#L66-L84
Smile-SA/elasticsuite
src/module-elasticsuite-core/Client/ClientBuilder.php
ClientBuilder.getHosts
private function getHosts($options) { $hosts = []; if (is_string($options['servers'])) { $options['servers'] = explode(',', $options['servers']); } foreach ($options['servers'] as $host) { if (!empty($host)) { list($hostname, $port) = array_p...
php
private function getHosts($options) { $hosts = []; if (is_string($options['servers'])) { $options['servers'] = explode(',', $options['servers']); } foreach ($options['servers'] as $host) { if (!empty($host)) { list($hostname, $port) = array_p...
[ "private", "function", "getHosts", "(", "$", "options", ")", "{", "$", "hosts", "=", "[", "]", ";", "if", "(", "is_string", "(", "$", "options", "[", "'servers'", "]", ")", ")", "{", "$", "options", "[", "'servers'", "]", "=", "explode", "(", "','"...
Return hosts config used to connect to the cluster. @param array $options Client options. See self::defaultOptions for available options. @return array
[ "Return", "hosts", "config", "used", "to", "connect", "to", "the", "cluster", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Client/ClientBuilder.php#L93-L120
Smile-SA/elasticsuite
src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig.php
RelevanceConfig.save
public function save() { $this->initScope(); $sectionId = $this->getSection(); $groups = $this->getGroups(); if (empty($groups)) { return $this; } $oldConfig = $this->_getConfig(true); $deleteTransaction = $this->_transactionFactory->create(); ...
php
public function save() { $this->initScope(); $sectionId = $this->getSection(); $groups = $this->getGroups(); if (empty($groups)) { return $this; } $oldConfig = $this->_getConfig(true); $deleteTransaction = $this->_transactionFactory->create(); ...
[ "public", "function", "save", "(", ")", "{", "$", "this", "->", "initScope", "(", ")", ";", "$", "sectionId", "=", "$", "this", "->", "getSection", "(", ")", ";", "$", "groups", "=", "$", "this", "->", "getGroups", "(", ")", ";", "if", "(", "empt...
Save config section Require set: section, website, store and groups @throws \Exception @return $this
[ "Save", "config", "section", "Require", "set", ":", "section", "website", "store", "and", "groups" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig.php#L106-L151
Smile-SA/elasticsuite
src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig.php
RelevanceConfig.load
public function load() { if ($this->_configData === null) { $this->initScope(); $this->_configData = $this->_getConfig(false); } return $this->_configData; }
php
public function load() { if ($this->_configData === null) { $this->initScope(); $this->_configData = $this->_getConfig(false); } return $this->_configData; }
[ "public", "function", "load", "(", ")", "{", "if", "(", "$", "this", "->", "_configData", "===", "null", ")", "{", "$", "this", "->", "initScope", "(", ")", ";", "$", "this", "->", "_configData", "=", "$", "this", "->", "_getConfig", "(", "false", ...
Load config data for section @return array
[ "Load", "config", "data", "for", "section" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig.php#L158-L166
Smile-SA/elasticsuite
src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig.php
RelevanceConfig.initScope
private function initScope() { if ($this->getSection() === null) { $this->setSection(''); } if ($this->getContainer() === null) { $this->setContainer(''); } if ($this->getStore() === null) { $this->setStore(''); } $scope = ...
php
private function initScope() { if ($this->getSection() === null) { $this->setSection(''); } if ($this->getContainer() === null) { $this->setContainer(''); } if ($this->getStore() === null) { $this->setStore(''); } $scope = ...
[ "private", "function", "initScope", "(", ")", "{", "if", "(", "$", "this", "->", "getSection", "(", ")", "===", "null", ")", "{", "$", "this", "->", "setSection", "(", "''", ")", ";", "}", "if", "(", "$", "this", "->", "getContainer", "(", ")", "...
Get scope name and scopeId @return void
[ "Get", "scope", "name", "and", "scopeId" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig.php#L173-L204
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Search/Request/Product/Attribute/AggregationResolver.php
AggregationResolver.getAggregationData
public function getAggregationData(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute) { $type = $attribute->getBackendType(); $aggregation = isset($this->aggregations[$type]) ? $this->aggregations[$type] : $this->defaultAggregation; if ($attribute->getBackendType() == 'va...
php
public function getAggregationData(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute) { $type = $attribute->getBackendType(); $aggregation = isset($this->aggregations[$type]) ? $this->aggregations[$type] : $this->defaultAggregation; if ($attribute->getBackendType() == 'va...
[ "public", "function", "getAggregationData", "(", "\\", "Magento", "\\", "Catalog", "\\", "Model", "\\", "ResourceModel", "\\", "Eav", "\\", "Attribute", "$", "attribute", ")", "{", "$", "type", "=", "$", "attribute", "->", "getBackendType", "(", ")", ";", ...
Get Aggregation Data for a given product attribute. @param \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute Product EAV Attribute @return array
[ "Get", "Aggregation", "Data", "for", "a", "given", "product", "attribute", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Attribute/AggregationResolver.php#L52-L76
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/ContainerConfiguration.php
ContainerConfiguration.getFilters
public function getFilters() { $filters = []; /** @var \Smile\ElasticsuiteCore\Api\Search\Request\Container\FilterInterface $filter */ foreach ($this->readBaseConfigParam('filters', []) as $filter) { // Not using the filter name as array key, to prevent collision with filters ad...
php
public function getFilters() { $filters = []; /** @var \Smile\ElasticsuiteCore\Api\Search\Request\Container\FilterInterface $filter */ foreach ($this->readBaseConfigParam('filters', []) as $filter) { // Not using the filter name as array key, to prevent collision with filters ad...
[ "public", "function", "getFilters", "(", ")", "{", "$", "filters", "=", "[", "]", ";", "/** @var \\Smile\\ElasticsuiteCore\\Api\\Search\\Request\\Container\\FilterInterface $filter */", "foreach", "(", "$", "this", "->", "readBaseConfigParam", "(", "'filters'", ",", "[", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration.php#L140-L151
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/ContainerConfiguration.php
ContainerConfiguration.getAggregations
public function getAggregations($query = null, $filters = [], $queryFilters = []) { $aggregations = $this->readBaseConfigParam('aggregations', []); /** @var \Smile\ElasticsuiteCore\Api\Search\Request\ContainerConfiguration\AggregationProviderInterface $provider */ foreach ($this->readBaseCo...
php
public function getAggregations($query = null, $filters = [], $queryFilters = []) { $aggregations = $this->readBaseConfigParam('aggregations', []); /** @var \Smile\ElasticsuiteCore\Api\Search\Request\ContainerConfiguration\AggregationProviderInterface $provider */ foreach ($this->readBaseCo...
[ "public", "function", "getAggregations", "(", "$", "query", "=", "null", ",", "$", "filters", "=", "[", "]", ",", "$", "queryFilters", "=", "[", "]", ")", "{", "$", "aggregations", "=", "$", "this", "->", "readBaseConfigParam", "(", "'aggregations'", ","...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration.php#L156-L169
Smile-SA/elasticsuite
src/module-elasticsuite-core/Search/Request/ContainerConfiguration.php
ContainerConfiguration.getIndex
private function getIndex() { $indexName = $this->readBaseConfigParam('index'); return $this->indexManager->getIndexByName($indexName, $this->storeId); }
php
private function getIndex() { $indexName = $this->readBaseConfigParam('index'); return $this->indexManager->getIndexByName($indexName, $this->storeId); }
[ "private", "function", "getIndex", "(", ")", "{", "$", "indexName", "=", "$", "this", "->", "readBaseConfigParam", "(", "'index'", ")", ";", "return", "$", "this", "->", "indexManager", "->", "getIndexByName", "(", "$", "indexName", ",", "$", "this", "->",...
Retrieve the index associated with the currrent search request container. @return IndexInterface
[ "Retrieve", "the", "index", "associated", "with", "the", "currrent", "search", "request", "container", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration.php#L189-L194
Smile-SA/elasticsuite
src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php
Form.canUseDefaultValue
public function canUseDefaultValue($fieldValue) { if ($this->getScope() == ContainerScopeInterface::SCOPE_STORE_CONTAINERS && $fieldValue) { return true; } if ($this->getScope() == ContainerScopeInterface::SCOPE_CONTAINERS && $fieldValue) { return true; } ...
php
public function canUseDefaultValue($fieldValue) { if ($this->getScope() == ContainerScopeInterface::SCOPE_STORE_CONTAINERS && $fieldValue) { return true; } if ($this->getScope() == ContainerScopeInterface::SCOPE_CONTAINERS && $fieldValue) { return true; } ...
[ "public", "function", "canUseDefaultValue", "(", "$", "fieldValue", ")", "{", "if", "(", "$", "this", "->", "getScope", "(", ")", "==", "ContainerScopeInterface", "::", "SCOPE_STORE_CONTAINERS", "&&", "$", "fieldValue", ")", "{", "return", "true", ";", "}", ...
Check if can use default value @param int $fieldValue The field value @return boolean
[ "Check", "if", "can", "use", "default", "value" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php#L90-L101
Smile-SA/elasticsuite
src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php
Form.getScopeLabel
public function getScopeLabel(Field $field) { $showInStore = $field->showInStore(); $showInContainer = $field->showInContainer(); if ($showInStore == 1) { return $this->_scopeLabels[ContainerScopeInterface::SCOPE_STORE_CONTAINERS]; } elseif ($showInContainer == 1) { ...
php
public function getScopeLabel(Field $field) { $showInStore = $field->showInStore(); $showInContainer = $field->showInContainer(); if ($showInStore == 1) { return $this->_scopeLabels[ContainerScopeInterface::SCOPE_STORE_CONTAINERS]; } elseif ($showInContainer == 1) { ...
[ "public", "function", "getScopeLabel", "(", "Field", "$", "field", ")", "{", "$", "showInStore", "=", "$", "field", "->", "showInStore", "(", ")", ";", "$", "showInContainer", "=", "$", "field", "->", "showInContainer", "(", ")", ";", "if", "(", "$", "...
Retrieve label for scope @param Field $field The field @return string
[ "Retrieve", "label", "for", "scope" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php#L126-L139
Smile-SA/elasticsuite
src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php
Form.getConfigValue
public function getConfigValue($path) { return $this->relevanceConfig->getValue($path, $this->getScope(), $this->getScopeCode()); }
php
public function getConfigValue($path) { return $this->relevanceConfig->getValue($path, $this->getScope(), $this->getScopeCode()); }
[ "public", "function", "getConfigValue", "(", "$", "path", ")", "{", "return", "$", "this", "->", "relevanceConfig", "->", "getValue", "(", "$", "path", ",", "$", "this", "->", "getScope", "(", ")", ",", "$", "this", "->", "getScopeCode", "(", ")", ")",...
Get config value @param string $path The config value path @return mixed
[ "Get", "config", "value" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php#L158-L161
Smile-SA/elasticsuite
src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php
Form.getScope
public function getScope() { $scope = $this->getData('scope'); if ($scope === null) { $scope = ContainerScopeInterface::SCOPE_DEFAULT; if ($this->getContainerCode()) { $scope = ContainerScopeInterface::SCOPE_CONTAINERS; } if ($this->g...
php
public function getScope() { $scope = $this->getData('scope'); if ($scope === null) { $scope = ContainerScopeInterface::SCOPE_DEFAULT; if ($this->getContainerCode()) { $scope = ContainerScopeInterface::SCOPE_CONTAINERS; } if ($this->g...
[ "public", "function", "getScope", "(", ")", "{", "$", "scope", "=", "$", "this", "->", "getData", "(", "'scope'", ")", ";", "if", "(", "$", "scope", "===", "null", ")", "{", "$", "scope", "=", "ContainerScopeInterface", "::", "SCOPE_DEFAULT", ";", "if"...
Retrieve current scope @return string
[ "Retrieve", "current", "scope" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php#L168-L186
Smile-SA/elasticsuite
src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php
Form.getScopeCode
public function getScopeCode() { $scopeCode = $this->getData('scope_code'); if ($scopeCode === null) { $scopeCode = 'default'; if ($this->getStoreCode()) { $store = $this->_storeManager->getStore($this->getStoreCode()); $scopeCode = $store->ge...
php
public function getScopeCode() { $scopeCode = $this->getData('scope_code'); if ($scopeCode === null) { $scopeCode = 'default'; if ($this->getStoreCode()) { $store = $this->_storeManager->getStore($this->getStoreCode()); $scopeCode = $store->ge...
[ "public", "function", "getScopeCode", "(", ")", "{", "$", "scopeCode", "=", "$", "this", "->", "getData", "(", "'scope_code'", ")", ";", "if", "(", "$", "scopeCode", "===", "null", ")", "{", "$", "scopeCode", "=", "'default'", ";", "if", "(", "$", "t...
Get current scope code @return string
[ "Get", "current", "scope", "code" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php#L193-L213
Smile-SA/elasticsuite
src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php
Form._initObjects
protected function _initObjects() { $this->_configDataObject = $this->_configFactory->create( [ 'data' => [ 'section' => $this->getSectionCode(), 'container' => $this->getContainerCode(), 'store' => $this->getStore...
php
protected function _initObjects() { $this->_configDataObject = $this->_configFactory->create( [ 'data' => [ 'section' => $this->getSectionCode(), 'container' => $this->getContainerCode(), 'store' => $this->getStore...
[ "protected", "function", "_initObjects", "(", ")", "{", "$", "this", "->", "_configDataObject", "=", "$", "this", "->", "_configFactory", "->", "create", "(", "[", "'data'", "=>", "[", "'section'", "=>", "$", "this", "->", "getSectionCode", "(", ")", ",", ...
Initialize objects required to render config form @SuppressWarnings(PHPMD.CamelCaseMethodName) @return $this
[ "Initialize", "objects", "required", "to", "render", "config", "form" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php#L222-L239
Smile-SA/elasticsuite
src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php
Form._initElement
protected function _initElement( \Magento\Config\Model\Config\Structure\Element\Field $field, \Magento\Framework\Data\Form\Element\Fieldset $fieldset, $path, $fieldPrefix = '', $labelPrefix = '' ) { $inherit = true; $data = $this->getConfigValue($path); ...
php
protected function _initElement( \Magento\Config\Model\Config\Structure\Element\Field $field, \Magento\Framework\Data\Form\Element\Fieldset $fieldset, $path, $fieldPrefix = '', $labelPrefix = '' ) { $inherit = true; $data = $this->getConfigValue($path); ...
[ "protected", "function", "_initElement", "(", "\\", "Magento", "\\", "Config", "\\", "Model", "\\", "Config", "\\", "Structure", "\\", "Element", "\\", "Field", "$", "field", ",", "\\", "Magento", "\\", "Framework", "\\", "Data", "\\", "Form", "\\", "Eleme...
Init form element from config. @SuppressWarnings(PHPMD.CamelCaseMethodName) @param \Magento\Config\Model\Config\Structure\Element\Field $field Form field. @param \Magento\Framework\Data\Form\Element\Fieldset $fieldset Form fieldset. @param string $path ...
[ "Init", "form", "element", "from", "config", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Form.php#L252-L334
Smile-SA/elasticsuite
src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Edit.php
Edit._prepareLayout
protected function _prepareLayout() { /** @var $section \Magento\Config\Model\Config\Structure\Element\Section */ $section = $this->configStructure->getElement($this->getRequest()->getParam('section')); $this->formBlockName = $section->getFrontendModel(); if (empty($this->formBlockNa...
php
protected function _prepareLayout() { /** @var $section \Magento\Config\Model\Config\Structure\Element\Section */ $section = $this->configStructure->getElement($this->getRequest()->getParam('section')); $this->formBlockName = $section->getFrontendModel(); if (empty($this->formBlockNa...
[ "protected", "function", "_prepareLayout", "(", ")", "{", "/** @var $section \\Magento\\Config\\Model\\Config\\Structure\\Element\\Section */", "$", "section", "=", "$", "this", "->", "configStructure", "->", "getElement", "(", "$", "this", "->", "getRequest", "(", ")", ...
Prepare layout object @SuppressWarnings(PHPMD.CamelCaseMethodName) @return \Magento\Framework\View\Element\AbstractBlock
[ "Prepare", "layout", "object" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Edit.php#L128-L155
Smile-SA/elasticsuite
src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/Chart/Spellcheck.php
Spellcheck.getChartOptions
public function getChartOptions() { $options = [ 'colors' => [self::COLOR_RED, self::COLOR_BLUE], ]; return $this->serializer->serialize($options); }
php
public function getChartOptions() { $options = [ 'colors' => [self::COLOR_RED, self::COLOR_BLUE], ]; return $this->serializer->serialize($options); }
[ "public", "function", "getChartOptions", "(", ")", "{", "$", "options", "=", "[", "'colors'", "=>", "[", "self", "::", "COLOR_RED", ",", "self", "::", "COLOR_BLUE", "]", ",", "]", ";", "return", "$", "this", "->", "serializer", "->", "serialize", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/Chart/Spellcheck.php#L59-L66
Smile-SA/elasticsuite
src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/Chart/Spellcheck.php
Spellcheck.getChartData
public function getChartData() { $data = [ 'cols' => [ ['type' => 'string', 'label' => __('Search type')], ['type' => 'number', 'label' => __('Rate')], ], 'rows' => [], ]; try { $reportData = $this->report->getD...
php
public function getChartData() { $data = [ 'cols' => [ ['type' => 'string', 'label' => __('Search type')], ['type' => 'number', 'label' => __('Rate')], ], 'rows' => [], ]; try { $reportData = $this->report->getD...
[ "public", "function", "getChartData", "(", ")", "{", "$", "data", "=", "[", "'cols'", "=>", "[", "[", "'type'", "=>", "'string'", ",", "'label'", "=>", "__", "(", "'Search type'", ")", "]", ",", "[", "'type'", "=>", "'number'", ",", "'label'", "=>", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/Chart/Spellcheck.php#L71-L107
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Model/Thesaurus.php
Thesaurus.getStoreIds
public function getStoreIds() { if ($this->storeManager->isSingleStoreMode()) { $this->storeIds = [$this->storeManager->getStore(true)->getId()]; } if (empty($this->storeIds)) { $this->storeIds = $this->getResource()->getStoreIdsFromThesaurusId($this->getThesaurusId(...
php
public function getStoreIds() { if ($this->storeManager->isSingleStoreMode()) { $this->storeIds = [$this->storeManager->getStore(true)->getId()]; } if (empty($this->storeIds)) { $this->storeIds = $this->getResource()->getStoreIdsFromThesaurusId($this->getThesaurusId(...
[ "public", "function", "getStoreIds", "(", ")", "{", "if", "(", "$", "this", "->", "storeManager", "->", "isSingleStoreMode", "(", ")", ")", "{", "$", "this", "->", "storeIds", "=", "[", "$", "this", "->", "storeManager", "->", "getStore", "(", "true", ...
Get store ids @return int[]
[ "Get", "store", "ids" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/Thesaurus.php#L192-L203
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Model/Thesaurus.php
Thesaurus.getTermsData
public function getTermsData() { if (empty($this->termsData)) { $this->termsData = $this->getResource()->getTermsDataFromThesaurus($this); } return $this->termsData; }
php
public function getTermsData() { if (empty($this->termsData)) { $this->termsData = $this->getResource()->getTermsDataFromThesaurus($this); } return $this->termsData; }
[ "public", "function", "getTermsData", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "termsData", ")", ")", "{", "$", "this", "->", "termsData", "=", "$", "this", "->", "getResource", "(", ")", "->", "getTermsDataFromThesaurus", "(", "$", "...
Get terms data @return array
[ "Get", "terms", "data" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/Thesaurus.php#L225-L232
Smile-SA/elasticsuite
src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Reader/ContainerStore.php
ContainerStore.read
public function read($code = null) { list($containerCode, $storeId) = explode("|", $code); $store = $this->storeManager->getStore($storeId); $config = array_replace_recursive( $this->containerReader->read($containerCode), $this->initialConfig->getData("{$containerCod...
php
public function read($code = null) { list($containerCode, $storeId) = explode("|", $code); $store = $this->storeManager->getStore($storeId); $config = array_replace_recursive( $this->containerReader->read($containerCode), $this->initialConfig->getData("{$containerCod...
[ "public", "function", "read", "(", "$", "code", "=", "null", ")", "{", "list", "(", "$", "containerCode", ",", "$", "storeId", ")", "=", "explode", "(", "\"|\"", ",", "$", "code", ")", ";", "$", "store", "=", "$", "this", "->", "storeManager", "->"...
Read configuration by code @param null|string $code The container code @return array
[ "Read", "configuration", "by", "code" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Reader/ContainerStore.php#L82-L105
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/InventoryData.php
InventoryData.addData
public function addData($storeId, array $indexData) { $inventoryData = $this->getResourceModel()->loadInventoryData($storeId, array_keys($indexData)); foreach ($inventoryData as $inventoryDataRow) { $productId = (int) $inventoryDataRow['product_id']; $indexData[$productId]['...
php
public function addData($storeId, array $indexData) { $inventoryData = $this->getResourceModel()->loadInventoryData($storeId, array_keys($indexData)); foreach ($inventoryData as $inventoryDataRow) { $productId = (int) $inventoryDataRow['product_id']; $indexData[$productId]['...
[ "public", "function", "addData", "(", "$", "storeId", ",", "array", "$", "indexData", ")", "{", "$", "inventoryData", "=", "$", "this", "->", "getResourceModel", "(", ")", "->", "loadInventoryData", "(", "$", "storeId", ",", "array_keys", "(", "$", "indexD...
Add inventory data to the index data. {@inheritdoc}
[ "Add", "inventory", "data", "to", "the", "index", "data", ".", "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/InventoryData.php#L62-L75
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/InventoryData.php
InventoryData.getResourceModel
private function getResourceModel() : InventoryDataInterface { if ($this->resourceModel === null) { $resourceName = InventoryDataInterface::class; try { // Will try to fetch default implementation and fail in case of missing MSI modules or dependencies. ...
php
private function getResourceModel() : InventoryDataInterface { if ($this->resourceModel === null) { $resourceName = InventoryDataInterface::class; try { // Will try to fetch default implementation and fail in case of missing MSI modules or dependencies. ...
[ "private", "function", "getResourceModel", "(", ")", ":", "InventoryDataInterface", "{", "if", "(", "$", "this", "->", "resourceModel", "===", "null", ")", "{", "$", "resourceName", "=", "InventoryDataInterface", "::", "class", ";", "try", "{", "// Will try to f...
Init proper resource model. Should be default implementation of InventoryDataInterface if MSI modules are enabled. Otherwise we fallback to old-style CatalogInventory indexing. @deprecated To be removed with Magento 2.4 and the dismantlement of legacy CatalogInventory module. @return InventoryDataInterface
[ "Init", "proper", "resource", "model", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/InventoryData.php#L88-L107
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Autocomplete/Product/Attribute/DataProvider.php
DataProvider.getItems
public function getItems() { $items = []; if ($this->autocompleteHelper->isEnabled($this->getType())) { foreach ($this->attributeConfig->getAutocompleteAttributeCollection() as $attribute) { $filterField = $this->attributeConfig->getFilterField($attribute); ...
php
public function getItems() { $items = []; if ($this->autocompleteHelper->isEnabled($this->getType())) { foreach ($this->attributeConfig->getAutocompleteAttributeCollection() as $attribute) { $filterField = $this->attributeConfig->getFilterField($attribute); ...
[ "public", "function", "getItems", "(", ")", "{", "$", "items", "=", "[", "]", ";", "if", "(", "$", "this", "->", "autocompleteHelper", "->", "isEnabled", "(", "$", "this", "->", "getType", "(", ")", ")", ")", "{", "foreach", "(", "$", "this", "->",...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Product/Attribute/DataProvider.php#L100-L130
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Applier/AttributeValue.php
AttributeValue.getFunction
public function getFunction(ContainerConfigurationInterface $containerConfiguration, OptimizerInterface $optimizer) { $field = $this->getField($containerConfiguration, $optimizer); $scaleFactor = (float) $optimizer->getConfig('scale_factor'); $function = [ 'field_value_fac...
php
public function getFunction(ContainerConfigurationInterface $containerConfiguration, OptimizerInterface $optimizer) { $field = $this->getField($containerConfiguration, $optimizer); $scaleFactor = (float) $optimizer->getConfig('scale_factor'); $function = [ 'field_value_fac...
[ "public", "function", "getFunction", "(", "ContainerConfigurationInterface", "$", "containerConfiguration", ",", "OptimizerInterface", "$", "optimizer", ")", "{", "$", "field", "=", "$", "this", "->", "getField", "(", "$", "containerConfiguration", ",", "$", "optimi...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Applier/AttributeValue.php#L56-L72
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Applier/AttributeValue.php
AttributeValue.getField
private function getField(ContainerConfigurationInterface $containerConfiguration, OptimizerInterface $optimizer) { $attributeCode = $optimizer->getConfig('attribute_code'); try { $attribute = $this->getAttribute($attributeCode); $field = $this->mappingHelper->getFilterF...
php
private function getField(ContainerConfigurationInterface $containerConfiguration, OptimizerInterface $optimizer) { $attributeCode = $optimizer->getConfig('attribute_code'); try { $attribute = $this->getAttribute($attributeCode); $field = $this->mappingHelper->getFilterF...
[ "private", "function", "getField", "(", "ContainerConfigurationInterface", "$", "containerConfiguration", ",", "OptimizerInterface", "$", "optimizer", ")", "{", "$", "attributeCode", "=", "$", "optimizer", "->", "getConfig", "(", "'attribute_code'", ")", ";", "try", ...
Get field to apply boost on. @param ContainerConfigurationInterface $containerConfiguration Container Configuration @param OptimizerInterface $optimizer Optimizer @return string
[ "Get", "field", "to", "apply", "boost", "on", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Applier/AttributeValue.php#L82-L99
Smile-SA/elasticsuite
src/module-elasticsuite-virtual-category/Setup/UpgradeSchema.php
UpgradeSchema.upgrade
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); if (version_compare($context->getVersion(), '1.2.0', '<')) { $this->virtualCategorySetup->addBlacklistColumnToPositionTable($setup); $this->virtualCategorySetup->set...
php
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); if (version_compare($context->getVersion(), '1.2.0', '<')) { $this->virtualCategorySetup->addBlacklistColumnToPositionTable($setup); $this->virtualCategorySetup->set...
[ "public", "function", "upgrade", "(", "SchemaSetupInterface", "$", "setup", ",", "ModuleContextInterface", "$", "context", ")", "{", "$", "setup", "->", "startSetup", "(", ")", ";", "if", "(", "version_compare", "(", "$", "context", "->", "getVersion", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Setup/UpgradeSchema.php#L48-L62
Smile-SA/elasticsuite
src/module-elasticsuite-core/Helper/AbstractConfiguration.php
AbstractConfiguration.getElasticSuiteConfigParam
protected function getElasticSuiteConfigParam($configField) { $path = self::BASE_CONFIG_XML_PREFIX . '/' . $configField; return $this->scopeConfig->getValue($path); }
php
protected function getElasticSuiteConfigParam($configField) { $path = self::BASE_CONFIG_XML_PREFIX . '/' . $configField; return $this->scopeConfig->getValue($path); }
[ "protected", "function", "getElasticSuiteConfigParam", "(", "$", "configField", ")", "{", "$", "path", "=", "self", "::", "BASE_CONFIG_XML_PREFIX", ".", "'/'", ".", "$", "configField", ";", "return", "$", "this", "->", "scopeConfig", "->", "getValue", "(", "$"...
Read a configuration param under the BASE_CONFIG_XML_PREFIX ('smile_elasticsuite_core_base_settings'). @param string $configField Configuration field name. @return mixed
[ "Read", "a", "configuration", "param", "under", "the", "BASE_CONFIG_XML_PREFIX", "(", "smile_elasticsuite_core_base_settings", ")", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Helper/AbstractConfiguration.php#L61-L66
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Preview.php
Preview.execute
public function execute() { $responseData = $this->getPreviewObject()->getData(); $json = $this->jsonHelper->jsonEncode($responseData); $this->getResponse()->representJson($json); }
php
public function execute() { $responseData = $this->getPreviewObject()->getData(); $json = $this->jsonHelper->jsonEncode($responseData); $this->getResponse()->representJson($json); }
[ "public", "function", "execute", "(", ")", "{", "$", "responseData", "=", "$", "this", "->", "getPreviewObject", "(", ")", "->", "getData", "(", ")", ";", "$", "json", "=", "$", "this", "->", "jsonHelper", "->", "jsonEncode", "(", "$", "responseData", ...
{@inheritDoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Preview.php#L91-L97
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Preview.php
Preview.getPreviewObject
private function getPreviewObject() { $optimizer = $this->getOptimizer(); $pageSize = $this->getPageSize(); $queryText = $this->getQueryText(); $category = $this->getCategory(); $containerConfig = $this->getContainerConfiguration(); return $...
php
private function getPreviewObject() { $optimizer = $this->getOptimizer(); $pageSize = $this->getPageSize(); $queryText = $this->getQueryText(); $category = $this->getCategory(); $containerConfig = $this->getContainerConfiguration(); return $...
[ "private", "function", "getPreviewObject", "(", ")", "{", "$", "optimizer", "=", "$", "this", "->", "getOptimizer", "(", ")", ";", "$", "pageSize", "=", "$", "this", "->", "getPageSize", "(", ")", ";", "$", "queryText", "=", "$", "this", "->", "getQuer...
Load and initialize the preview model. @return \Smile\ElasticsuiteVirtualCategory\Model\Preview
[ "Load", "and", "initialize", "the", "preview", "model", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Preview.php#L115-L132
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Preview.php
Preview.getOptimizer
private function getOptimizer() { $optimizer = $this->optimizerFactory->create(); $optimizer->setData($this->getRequest()->getPostValue()); $ruleConditionPost = $this->getRequest()->getParam('rule_condition', []); $optimizer->getRuleCondition()->loadPost($ruleConditionPost); ...
php
private function getOptimizer() { $optimizer = $this->optimizerFactory->create(); $optimizer->setData($this->getRequest()->getPostValue()); $ruleConditionPost = $this->getRequest()->getParam('rule_condition', []); $optimizer->getRuleCondition()->loadPost($ruleConditionPost); ...
[ "private", "function", "getOptimizer", "(", ")", "{", "$", "optimizer", "=", "$", "this", "->", "optimizerFactory", "->", "create", "(", ")", ";", "$", "optimizer", "->", "setData", "(", "$", "this", "->", "getRequest", "(", ")", "->", "getPostValue", "(...
Load current category and apply admin current modifications (added and removed products, updated virtual rule, ...). @return OptimizerInterface
[ "Load", "current", "category", "and", "apply", "admin", "current", "modifications", "(", "added", "and", "removed", "products", "updated", "virtual", "rule", "...", ")", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Preview.php#L139-L147
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Preview.php
Preview.getCategory
private function getCategory() { $storeId = $this->getStoreId(); $categoryId = $this->getCategoryId(); $category = null; if ($this->getCategoryId()) { $category = $this->categoryRepository->get($categoryId, $storeId); } return $category; }
php
private function getCategory() { $storeId = $this->getStoreId(); $categoryId = $this->getCategoryId(); $category = null; if ($this->getCategoryId()) { $category = $this->categoryRepository->get($categoryId, $storeId); } return $category; }
[ "private", "function", "getCategory", "(", ")", "{", "$", "storeId", "=", "$", "this", "->", "getStoreId", "(", ")", ";", "$", "categoryId", "=", "$", "this", "->", "getCategoryId", "(", ")", ";", "$", "category", "=", "null", ";", "if", "(", "$", ...
Load current category using the request params. @return CategoryInterface
[ "Load", "current", "category", "using", "the", "request", "params", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Preview.php#L154-L165
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Preview.php
Preview.getContainerConfiguration
private function getContainerConfiguration() { $containerName = $this->getRequest()->getParam('search_container_preview'); $containerConfig = $this->containerConfigFactory->create( ['containerName' => $containerName, 'storeId' => $this->getOptimizer()->getStoreId()] ); ...
php
private function getContainerConfiguration() { $containerName = $this->getRequest()->getParam('search_container_preview'); $containerConfig = $this->containerConfigFactory->create( ['containerName' => $containerName, 'storeId' => $this->getOptimizer()->getStoreId()] ); ...
[ "private", "function", "getContainerConfiguration", "(", ")", "{", "$", "containerName", "=", "$", "this", "->", "getRequest", "(", ")", "->", "getParam", "(", "'search_container_preview'", ")", ";", "$", "containerConfig", "=", "$", "this", "->", "containerConf...
Return the container to preview. @return ContainerConfigurationInterface
[ "Return", "the", "container", "to", "preview", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Preview.php#L182-L191
Smile-SA/elasticsuite
src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Preview.php
Preview.getQueryText
private function getQueryText() { $queryText = trim(strtolower((string) $this->getRequest()->getParam('query_text_preview', ''))); if ($queryText == '') { $queryText = null; } return $queryText; }
php
private function getQueryText() { $queryText = trim(strtolower((string) $this->getRequest()->getParam('query_text_preview', ''))); if ($queryText == '') { $queryText = null; } return $queryText; }
[ "private", "function", "getQueryText", "(", ")", "{", "$", "queryText", "=", "trim", "(", "strtolower", "(", "(", "string", ")", "$", "this", "->", "getRequest", "(", ")", "->", "getParam", "(", "'query_text_preview'", ",", "''", ")", ")", ")", ";", "i...
Return the query text to preview. @return string
[ "Return", "the", "query", "text", "to", "preview", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Preview.php#L198-L207
Smile-SA/elasticsuite
src/module-elasticsuite-core/Index/Analysis/Config.php
Config.get
public function get($language = null, $default = null) { if ($language === null) { $language = 'default'; } $data = parent::get($language, null); if ($data === null) { $data = $this->get('default', $default); } return $data; }
php
public function get($language = null, $default = null) { if ($language === null) { $language = 'default'; } $data = parent::get($language, null); if ($data === null) { $data = $this->get('default', $default); } return $data; }
[ "public", "function", "get", "(", "$", "language", "=", "null", ",", "$", "default", "=", "null", ")", "{", "if", "(", "$", "language", "===", "null", ")", "{", "$", "language", "=", "'default'", ";", "}", "$", "data", "=", "parent", "::", "get", ...
Return analysis config by language. @param string $language A language code (eg: en, fr, ...). @param mixed $default Default value if no config is found. @return mixed
[ "Return", "analysis", "config", "by", "language", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Analysis/Config.php#L56-L69
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Action/FullFactory.php
FullFactory.create
public function create(array $data = []) { $engine = $this->scopeConfig->getValue($this->configPath, ScopeInterface::SCOPE_STORE); $fullActionClass = $this->fullActionPool['default']; if (isset($this->fullActionPool[$engine])) { $fullActionClass = $this->fullActionPool[$engine]...
php
public function create(array $data = []) { $engine = $this->scopeConfig->getValue($this->configPath, ScopeInterface::SCOPE_STORE); $fullActionClass = $this->fullActionPool['default']; if (isset($this->fullActionPool[$engine])) { $fullActionClass = $this->fullActionPool[$engine]...
[ "public", "function", "create", "(", "array", "$", "data", "=", "[", "]", ")", "{", "$", "engine", "=", "$", "this", "->", "scopeConfig", "->", "getValue", "(", "$", "this", "->", "configPath", ",", "ScopeInterface", "::", "SCOPE_STORE", ")", ";", "$",...
Create an indexer using the right class depending of the configuration. @param array $data Data passed to the indexer while it is instantiated. @return mixed
[ "Create", "an", "indexer", "using", "the", "right", "class", "depending", "of", "the", "configuration", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Action/FullFactory.php#L80-L91
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/Product/Search/Request/Container/Filter/Stock.php
Stock.getFilterQuery
public function getFilterQuery() { $query = null; if (false === $this->isEnabledShowOutOfStock($this->searchContext->getStoreId())) { $query = $this->queryFactory->create(QueryInterface::TYPE_TERM, ['field' => 'stock.is_in_stock', 'value' => true]); } return $query; ...
php
public function getFilterQuery() { $query = null; if (false === $this->isEnabledShowOutOfStock($this->searchContext->getStoreId())) { $query = $this->queryFactory->create(QueryInterface::TYPE_TERM, ['field' => 'stock.is_in_stock', 'value' => true]); } return $query; ...
[ "public", "function", "getFilterQuery", "(", ")", "{", "$", "query", "=", "null", ";", "if", "(", "false", "===", "$", "this", "->", "isEnabledShowOutOfStock", "(", "$", "this", "->", "searchContext", "->", "getStoreId", "(", ")", ")", ")", "{", "$", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Search/Request/Container/Filter/Stock.php#L64-L73
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Controller/Adminhtml/Thesaurus/Edit.php
Edit.execute
public function execute() { $resultPage = $this->createPage(); $thesaurusId = (int) $this->getRequest()->getParam(ThesaurusInterface::THESAURUS_ID); $type = (string) $this->getRequest()->getParam('type'); $thesaurus = null; $isExistingThesaurus = (bool) $thesaurusId;...
php
public function execute() { $resultPage = $this->createPage(); $thesaurusId = (int) $this->getRequest()->getParam(ThesaurusInterface::THESAURUS_ID); $type = (string) $this->getRequest()->getParam('type'); $thesaurus = null; $isExistingThesaurus = (bool) $thesaurusId;...
[ "public", "function", "execute", "(", ")", "{", "$", "resultPage", "=", "$", "this", "->", "createPage", "(", ")", ";", "$", "thesaurusId", "=", "(", "int", ")", "$", "this", "->", "getRequest", "(", ")", "->", "getParam", "(", "ThesaurusInterface", ":...
Render Thesaurus edition screen @return \Magento\Backend\Model\View\Result\Page
[ "Render", "Thesaurus", "edition", "screen" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Controller/Adminhtml/Thesaurus/Edit.php#L35-L70
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/ResourceModel/Category/FilterableAttribute.php
FilterableAttribute.loadAttributesData
public function loadAttributesData(int $categoryId) { $binds = [':category_id' => $categoryId]; $select = $this->getConnection()->select(); $select->from($this->getMainTable())->where(sprintf("%s = :category_id", $this->getIdFieldName())); return $this->getConnection()->fetchAll($s...
php
public function loadAttributesData(int $categoryId) { $binds = [':category_id' => $categoryId]; $select = $this->getConnection()->select(); $select->from($this->getMainTable())->where(sprintf("%s = :category_id", $this->getIdFieldName())); return $this->getConnection()->fetchAll($s...
[ "public", "function", "loadAttributesData", "(", "int", "$", "categoryId", ")", "{", "$", "binds", "=", "[", "':category_id'", "=>", "$", "categoryId", "]", ";", "$", "select", "=", "$", "this", "->", "getConnection", "(", ")", "->", "select", "(", ")", ...
Retrieve Layered Navigation Filters for a given category. @param int $categoryId The category Id @return array @throws \Magento\Framework\Exception\LocalizedException
[ "Retrieve", "Layered", "Navigation", "Filters", "for", "a", "given", "category", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Category/FilterableAttribute.php#L59-L67
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/ResourceModel/Category/FilterableAttribute.php
FilterableAttribute.saveAttributesData
public function saveAttributesData(int $categoryId, array $data) { $rows = []; $this->deleteByCategoryId($categoryId); $fields = $this->getConnection()->describeTable($this->getMainTable()); foreach ($data as $item) { $item[$this->getIdFieldName()] = $categoryId; ...
php
public function saveAttributesData(int $categoryId, array $data) { $rows = []; $this->deleteByCategoryId($categoryId); $fields = $this->getConnection()->describeTable($this->getMainTable()); foreach ($data as $item) { $item[$this->getIdFieldName()] = $categoryId; ...
[ "public", "function", "saveAttributesData", "(", "int", "$", "categoryId", ",", "array", "$", "data", ")", "{", "$", "rows", "=", "[", "]", ";", "$", "this", "->", "deleteByCategoryId", "(", "$", "categoryId", ")", ";", "$", "fields", "=", "$", "this",...
Save Layered Navigation Filters configuration for a given category. @param int $categoryId The category Id @param array $data layered navigation filters configuration data. @return array @throws \Magento\Framework\Exception\LocalizedException
[ "Save", "Layered", "Navigation", "Filters", "configuration", "for", "a", "given", "category", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Category/FilterableAttribute.php#L78-L98
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/ResourceModel/Category/FilterableAttribute.php
FilterableAttribute.deleteByCategoryId
public function deleteByCategoryId(int $categoryId) { $deleteCondition = [sprintf("%s = ?", $this->getIdFieldName()) => $categoryId]; return (bool) $this->getConnection()->delete($this->getMainTable(), $deleteCondition); }
php
public function deleteByCategoryId(int $categoryId) { $deleteCondition = [sprintf("%s = ?", $this->getIdFieldName()) => $categoryId]; return (bool) $this->getConnection()->delete($this->getMainTable(), $deleteCondition); }
[ "public", "function", "deleteByCategoryId", "(", "int", "$", "categoryId", ")", "{", "$", "deleteCondition", "=", "[", "sprintf", "(", "\"%s = ?\"", ",", "$", "this", "->", "getIdFieldName", "(", ")", ")", "=>", "$", "categoryId", "]", ";", "return", "(", ...
Delete layered filters configuration by Category Id. @param int $categoryId Category Id @return bool
[ "Delete", "layered", "filters", "configuration", "by", "Category", "Id", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Category/FilterableAttribute.php#L107-L112
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/ResourceModel/Category/FilterableAttribute.php
FilterableAttribute._construct
protected function _construct() { $idField = $this->metadataPool->getMetadata(CategoryInterface::class)->getIdentifierField(); $this->_init('smile_elasticsuitecatalog_category_filterable_attribute', $idField); }
php
protected function _construct() { $idField = $this->metadataPool->getMetadata(CategoryInterface::class)->getIdentifierField(); $this->_init('smile_elasticsuitecatalog_category_filterable_attribute', $idField); }
[ "protected", "function", "_construct", "(", ")", "{", "$", "idField", "=", "$", "this", "->", "metadataPool", "->", "getMetadata", "(", "CategoryInterface", "::", "class", ")", "->", "getIdentifierField", "(", ")", ";", "$", "this", "->", "_init", "(", "'s...
Resource initialization @SuppressWarnings(PHPMD.CamelCaseMethodName) Method is inherited. @return void
[ "Resource", "initialization" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Category/FilterableAttribute.php#L121-L125
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/ResourceModel/Category/FilterableAttribute.php
FilterableAttribute.buildRow
private function buildRow($item, $fields) { // Remove position for not pinned items. if (empty($item['is_pinned']) || filter_var($item['is_pinned'], FILTER_VALIDATE_BOOLEAN) === false) { $item['position'] = null; } foreach (array_keys($fields) as $field) { $u...
php
private function buildRow($item, $fields) { // Remove position for not pinned items. if (empty($item['is_pinned']) || filter_var($item['is_pinned'], FILTER_VALIDATE_BOOLEAN) === false) { $item['position'] = null; } foreach (array_keys($fields) as $field) { $u...
[ "private", "function", "buildRow", "(", "$", "item", ",", "$", "fields", ")", "{", "// Remove position for not pinned items.", "if", "(", "empty", "(", "$", "item", "[", "'is_pinned'", "]", ")", "||", "filter_var", "(", "$", "item", "[", "'is_pinned'", "]", ...
Compute row data for later insert. @param array $item The item to build @param array $fields The fields to keep @return array
[ "Compute", "row", "data", "for", "later", "insert", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Category/FilterableAttribute.php#L135-L151
Smile-SA/elasticsuite
src/module-elasticsuite-catalog/Model/ResourceModel/Category/FilterableAttribute.php
FilterableAttribute.isValid
private function isValid($row) { $result = false; // Check if facet_display_mode is defaulted. if ((int) $row['facet_display_mode'] !== FilterDisplayMode::AUTO_DISPLAYED) { $result = true; } // Check remaining fields are not null. unset($row[$this->getId...
php
private function isValid($row) { $result = false; // Check if facet_display_mode is defaulted. if ((int) $row['facet_display_mode'] !== FilterDisplayMode::AUTO_DISPLAYED) { $result = true; } // Check remaining fields are not null. unset($row[$this->getId...
[ "private", "function", "isValid", "(", "$", "row", ")", "{", "$", "result", "=", "false", ";", "// Check if facet_display_mode is defaulted.", "if", "(", "(", "int", ")", "$", "row", "[", "'facet_display_mode'", "]", "!==", "FilterDisplayMode", "::", "AUTO_DISPL...
Check if a given row is relevant to save. @param array $row A row to be saved in table. @return boolean
[ "Check", "if", "a", "given", "row", "is", "relevant", "to", "save", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Category/FilterableAttribute.php#L160-L179
Smile-SA/elasticsuite
src/module-elasticsuite-thesaurus/Plugin/Query.php
Query.aroundSave
public function aroundSave(QueryModel $subject, \Closure $proceed) { $needReindex = $subject->dataHasChangedFor('synonym_for'); $result = $proceed(); if ($needReindex) { $this->indexerRegistry->get(ThesaurusIndexer::INDEXER_ID)->invalidate(); } return $result; ...
php
public function aroundSave(QueryModel $subject, \Closure $proceed) { $needReindex = $subject->dataHasChangedFor('synonym_for'); $result = $proceed(); if ($needReindex) { $this->indexerRegistry->get(ThesaurusIndexer::INDEXER_ID)->invalidate(); } return $result; ...
[ "public", "function", "aroundSave", "(", "QueryModel", "$", "subject", ",", "\\", "Closure", "$", "proceed", ")", "{", "$", "needReindex", "=", "$", "subject", "->", "dataHasChangedFor", "(", "'synonym_for'", ")", ";", "$", "result", "=", "$", "proceed", "...
Ensure the index is invalidated when synonyms are updated. @param QueryModel $subject Saved query. @param \Closure $proceed Original save method. @return QueryModel
[ "Ensure", "the", "index", "is", "invalidated", "when", "synonyms", "are", "updated", "." ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Plugin/Query.php#L70-L81
Smile-SA/elasticsuite
src/module-elasticsuite-core/Controller/Adminhtml/Search/Request/RelevanceConfig/Save.php
Save.execute
public function execute() { try { $section = $this->getRequest()->getParam('section'); $container = $this->getRequest()->getParam('container'); $store = $this->getRequest()->getParam('store'); $configData = [ 'section' => $section, ...
php
public function execute() { try { $section = $this->getRequest()->getParam('section'); $container = $this->getRequest()->getParam('container'); $store = $this->getRequest()->getParam('store'); $configData = [ 'section' => $section, ...
[ "public", "function", "execute", "(", ")", "{", "try", "{", "$", "section", "=", "$", "this", "->", "getRequest", "(", ")", "->", "getParam", "(", "'section'", ")", ";", "$", "container", "=", "$", "this", "->", "getRequest", "(", ")", "->", "getPara...
Save configuration @return \Magento\Backend\Model\View\Result\Redirect
[ "Save", "configuration" ]
train
https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Controller/Adminhtml/Search/Request/RelevanceConfig/Save.php#L78-L119