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 |
|---|---|---|---|---|---|---|---|---|---|---|
oscarotero/Embed | src/Adapters/Wikipedia.php | Wikipedia.init | protected function init()
{
parent::init();
$this->providers = ['wikipedia' => new Api\Wikipedia($this)] + $this->providers;
} | php | protected function init()
{
parent::init();
$this->providers = ['wikipedia' => new Api\Wikipedia($this)] + $this->providers;
} | [
"protected",
"function",
"init",
"(",
")",
"{",
"parent",
"::",
"init",
"(",
")",
";",
"$",
"this",
"->",
"providers",
"=",
"[",
"'wikipedia'",
"=>",
"new",
"Api",
"\\",
"Wikipedia",
"(",
"$",
"this",
")",
"]",
"+",
"$",
"this",
"->",
"providers",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oscarotero/Embed/blob/bc80c5da565ae1576aa4bd909949ca15e92badfb/src/Adapters/Wikipedia.php#L26-L31 |
oscarotero/Embed | src/Providers/OEmbed/Spotify.php | Spotify.getEndPoint | public function getEndPoint()
{
return Url::create(static::$endPoint)
->withQueryParameters([
'url' => (string) $this->response->getUrl()->withQueryParameters([]),
'format' => 'json'
]);
} | php | public function getEndPoint()
{
return Url::create(static::$endPoint)
->withQueryParameters([
'url' => (string) $this->response->getUrl()->withQueryParameters([]),
'format' => 'json'
]);
} | [
"public",
"function",
"getEndPoint",
"(",
")",
"{",
"return",
"Url",
"::",
"create",
"(",
"static",
"::",
"$",
"endPoint",
")",
"->",
"withQueryParameters",
"(",
"[",
"'url'",
"=>",
"(",
"string",
")",
"$",
"this",
"->",
"response",
"->",
"getUrl",
"(",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oscarotero/Embed/blob/bc80c5da565ae1576aa4bd909949ca15e92badfb/src/Providers/OEmbed/Spotify.php#L15-L22 |
oscarotero/Embed | src/Adapters/Google.php | Google.init | protected function init()
{
parent::init();
if ($this->getResponse()->getUrl()->match('*/maps/*')) {
$this->providers = ['google' => new Api\GoogleMaps($this)] + $this->providers;
}
} | php | protected function init()
{
parent::init();
if ($this->getResponse()->getUrl()->match('*/maps/*')) {
$this->providers = ['google' => new Api\GoogleMaps($this)] + $this->providers;
}
} | [
"protected",
"function",
"init",
"(",
")",
"{",
"parent",
"::",
"init",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getResponse",
"(",
")",
"->",
"getUrl",
"(",
")",
"->",
"match",
"(",
"'*/maps/*'",
")",
")",
"{",
"$",
"this",
"->",
"providers",... | {@inheritdoc} | [
"{"
] | train | https://github.com/oscarotero/Embed/blob/bc80c5da565ae1576aa4bd909949ca15e92badfb/src/Adapters/Google.php#L31-L38 |
oscarotero/Embed | src/Adapters/Google.php | Google.getCode | public function getCode()
{
$this->width = null;
$this->height = null;
$url = $this->getResponse()->getUrl();
if ($url->getHost() === 'plus.google.com') {
return '<script src="https://apis.google.com/js/plusone.js" type="text/javascript"></script>'
.'<di... | php | public function getCode()
{
$this->width = null;
$this->height = null;
$url = $this->getResponse()->getUrl();
if ($url->getHost() === 'plus.google.com') {
return '<script src="https://apis.google.com/js/plusone.js" type="text/javascript"></script>'
.'<di... | [
"public",
"function",
"getCode",
"(",
")",
"{",
"$",
"this",
"->",
"width",
"=",
"null",
";",
"$",
"this",
"->",
"height",
"=",
"null",
";",
"$",
"url",
"=",
"$",
"this",
"->",
"getResponse",
"(",
")",
"->",
"getUrl",
"(",
")",
";",
"if",
"(",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oscarotero/Embed/blob/bc80c5da565ae1576aa4bd909949ca15e92badfb/src/Adapters/Google.php#L43-L66 |
oscarotero/Embed | src/Providers/OEmbed/Scribd.php | Scribd.getEndPoint | public function getEndPoint()
{
$url = $this->response->getUrl()->withDirectoryPosition(0, 'doc');
return Url::create(static::$endPoint)
->withQueryParameters([
'url' => (string) $url,
'format' => 'json',
]);
} | php | public function getEndPoint()
{
$url = $this->response->getUrl()->withDirectoryPosition(0, 'doc');
return Url::create(static::$endPoint)
->withQueryParameters([
'url' => (string) $url,
'format' => 'json',
]);
} | [
"public",
"function",
"getEndPoint",
"(",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"response",
"->",
"getUrl",
"(",
")",
"->",
"withDirectoryPosition",
"(",
"0",
",",
"'doc'",
")",
";",
"return",
"Url",
"::",
"create",
"(",
"static",
"::",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oscarotero/Embed/blob/bc80c5da565ae1576aa4bd909949ca15e92badfb/src/Providers/OEmbed/Scribd.php#L18-L27 |
oscarotero/Embed | src/Providers/Api/Wikipedia.php | Wikipedia.getTitle | public function getTitle()
{
$pages = $this->bag->get('extracts[query][pages]');
if (!empty($pages)) {
$page = current($pages);
return strip_tags($page['title']);
}
} | php | public function getTitle()
{
$pages = $this->bag->get('extracts[query][pages]');
if (!empty($pages)) {
$page = current($pages);
return strip_tags($page['title']);
}
} | [
"public",
"function",
"getTitle",
"(",
")",
"{",
"$",
"pages",
"=",
"$",
"this",
"->",
"bag",
"->",
"get",
"(",
"'extracts[query][pages]'",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"pages",
")",
")",
"{",
"$",
"page",
"=",
"current",
"(",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oscarotero/Embed/blob/bc80c5da565ae1576aa4bd909949ca15e92badfb/src/Providers/Api/Wikipedia.php#L56-L65 |
oscarotero/Embed | src/Providers/Api/Wikipedia.php | Wikipedia.getDescription | public function getDescription()
{
$pages = $this->bag->get('extracts[query][pages]');
if (!empty($pages)) {
return $this->bag->get('extracts[query][pages]['.key($pages).'][extract]');
}
} | php | public function getDescription()
{
$pages = $this->bag->get('extracts[query][pages]');
if (!empty($pages)) {
return $this->bag->get('extracts[query][pages]['.key($pages).'][extract]');
}
} | [
"public",
"function",
"getDescription",
"(",
")",
"{",
"$",
"pages",
"=",
"$",
"this",
"->",
"bag",
"->",
"get",
"(",
"'extracts[query][pages]'",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"pages",
")",
")",
"{",
"return",
"$",
"this",
"->",
"bag",... | {@inheritdoc} | [
"{"
] | train | https://github.com/oscarotero/Embed/blob/bc80c5da565ae1576aa4bd909949ca15e92badfb/src/Providers/Api/Wikipedia.php#L70-L77 |
oscarotero/Embed | src/Providers/Api/Wikipedia.php | Wikipedia.getImagesUrls | public function getImagesUrls()
{
$images = [];
$pages = $this->bag->get('images[query][pages]');
if (!empty($pages)) {
$page = current($pages);
$imgs = [];
if (isset($page['images'])) {
foreach ($page['images'] as $image) {
... | php | public function getImagesUrls()
{
$images = [];
$pages = $this->bag->get('images[query][pages]');
if (!empty($pages)) {
$page = current($pages);
$imgs = [];
if (isset($page['images'])) {
foreach ($page['images'] as $image) {
... | [
"public",
"function",
"getImagesUrls",
"(",
")",
"{",
"$",
"images",
"=",
"[",
"]",
";",
"$",
"pages",
"=",
"$",
"this",
"->",
"bag",
"->",
"get",
"(",
"'images[query][pages]'",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"pages",
")",
")",
"{",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oscarotero/Embed/blob/bc80c5da565ae1576aa4bd909949ca15e92badfb/src/Providers/Api/Wikipedia.php#L82-L133 |
timber/starter-theme | functions.php | StarterSite.add_to_context | public function add_to_context( $context ) {
$context['foo'] = 'bar';
$context['stuff'] = 'I am a value set in your functions.php file';
$context['notes'] = 'These values are available everytime you call Timber::context();';
$context['menu'] = new Timber\Menu();
$context['site'] = $this;
return $context;
} | php | public function add_to_context( $context ) {
$context['foo'] = 'bar';
$context['stuff'] = 'I am a value set in your functions.php file';
$context['notes'] = 'These values are available everytime you call Timber::context();';
$context['menu'] = new Timber\Menu();
$context['site'] = $this;
return $context;
} | [
"public",
"function",
"add_to_context",
"(",
"$",
"context",
")",
"{",
"$",
"context",
"[",
"'foo'",
"]",
"=",
"'bar'",
";",
"$",
"context",
"[",
"'stuff'",
"]",
"=",
"'I am a value set in your functions.php file'",
";",
"$",
"context",
"[",
"'notes'",
"]",
... | This is where you add some context
@param string $context context['this'] Being the Twig's {{ this }}. | [
"This",
"is",
"where",
"you",
"add",
"some",
"context"
] | train | https://github.com/timber/starter-theme/blob/cb1037d6ab36fece5f2388a916e540d986892bde/functions.php#L62-L69 |
timber/starter-theme | functions.php | StarterSite.add_to_twig | public function add_to_twig( $twig ) {
$twig->addExtension( new Twig_Extension_StringLoader() );
$twig->addFilter( new Twig_SimpleFilter( 'myfoo', array( $this, 'myfoo' ) ) );
return $twig;
} | php | public function add_to_twig( $twig ) {
$twig->addExtension( new Twig_Extension_StringLoader() );
$twig->addFilter( new Twig_SimpleFilter( 'myfoo', array( $this, 'myfoo' ) ) );
return $twig;
} | [
"public",
"function",
"add_to_twig",
"(",
"$",
"twig",
")",
"{",
"$",
"twig",
"->",
"addExtension",
"(",
"new",
"Twig_Extension_StringLoader",
"(",
")",
")",
";",
"$",
"twig",
"->",
"addFilter",
"(",
"new",
"Twig_SimpleFilter",
"(",
"'myfoo'",
",",
"array",
... | This is where you can add your own functions to twig.
@param string $twig get extension. | [
"This",
"is",
"where",
"you",
"can",
"add",
"your",
"own",
"functions",
"to",
"twig",
"."
] | train | https://github.com/timber/starter-theme/blob/cb1037d6ab36fece5f2388a916e540d986892bde/functions.php#L136-L140 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Block/Adminhtml/Thesaurus/Grid.php | Grid._preparePage | protected function _preparePage()
{
parent::_preparePage();
$this->getColumnSet()->getChildBlock('store_id')->setFilterConditionCallback([$this, 'filterStoreCondition']);
$this->getColumnSet()->getChildBlock('thesaurus_terms_summary')->setFilterConditionCallback([$this, 'filterTermsCondition... | php | protected function _preparePage()
{
parent::_preparePage();
$this->getColumnSet()->getChildBlock('store_id')->setFilterConditionCallback([$this, 'filterStoreCondition']);
$this->getColumnSet()->getChildBlock('thesaurus_terms_summary')->setFilterConditionCallback([$this, 'filterTermsCondition... | [
"protected",
"function",
"_preparePage",
"(",
")",
"{",
"parent",
"::",
"_preparePage",
"(",
")",
";",
"$",
"this",
"->",
"getColumnSet",
"(",
")",
"->",
"getChildBlock",
"(",
"'store_id'",
")",
"->",
"setFilterConditionCallback",
"(",
"[",
"$",
"this",
",",... | Append custom filter for Store Id
@SuppressWarnings(PHPMD.CamelCaseMethodName) | [
"Append",
"custom",
"filter",
"for",
"Store",
"Id"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Block/Adminhtml/Thesaurus/Grid.php#L30-L35 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Block/Adminhtml/Thesaurus/Grid.php | Grid.filterStoreCondition | protected function filterStoreCondition($collection, $column)
{
if (!($value = $column->getFilter()->getValue())) {
return;
}
$collection->addStoreFilter($value);
} | php | protected function filterStoreCondition($collection, $column)
{
if (!($value = $column->getFilter()->getValue())) {
return;
}
$collection->addStoreFilter($value);
} | [
"protected",
"function",
"filterStoreCondition",
"(",
"$",
"collection",
",",
"$",
"column",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"value",
"=",
"$",
"column",
"->",
"getFilter",
"(",
")",
"->",
"getValue",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
... | Apply store filter
@param \Magento\Framework\Data\Collection $collection The collection
@param \Magento\Backend\Block\Widget\Grid\Column $column Columns to filter | [
"Apply",
"store",
"filter"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Block/Adminhtml/Thesaurus/Grid.php#L43-L50 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Block/Adminhtml/Thesaurus/Grid.php | Grid.filterTermsCondition | protected function filterTermsCondition($collection, $column)
{
if (!($value = $column->getFilter()->getValue())) {
return;
}
$collection->setTermFilter($value);
} | php | protected function filterTermsCondition($collection, $column)
{
if (!($value = $column->getFilter()->getValue())) {
return;
}
$collection->setTermFilter($value);
} | [
"protected",
"function",
"filterTermsCondition",
"(",
"$",
"collection",
",",
"$",
"column",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"value",
"=",
"$",
"column",
"->",
"getFilter",
"(",
")",
"->",
"getValue",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
... | Apply term filter
@param \Magento\Framework\Data\Collection $collection The collection
@param \Magento\Backend\Block\Widget\Grid\Column $column Columns to filter | [
"Apply",
"term",
"filter"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Block/Adminhtml/Thesaurus/Grid.php#L58-L65 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Plugin/QueryRewrite.php | QueryRewrite.aroundCreate | public function aroundCreate(
QueryBuilder $subject,
\Closure $proceed,
ContainerConfigurationInterface $containerConfig,
$queryText,
$spellingType,
$boost = 1
) {
$storeId = $containerConfig->getStoreId();
$requestName = $containerConfig-... | php | public function aroundCreate(
QueryBuilder $subject,
\Closure $proceed,
ContainerConfigurationInterface $containerConfig,
$queryText,
$spellingType,
$boost = 1
) {
$storeId = $containerConfig->getStoreId();
$requestName = $containerConfig-... | [
"public",
"function",
"aroundCreate",
"(",
"QueryBuilder",
"$",
"subject",
",",
"\\",
"Closure",
"$",
"proceed",
",",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"$",
"queryText",
",",
"$",
"spellingType",
",",
"$",
"boost",
"=",
"1",
")",
... | Rewrite the query.
@SuppressWarnings(PHPMD.UnusedFormalParameter)
@param QueryBuilder $subject Original query builder.
@param \Closure $proceed Original create func.
@param ContainerConfigurationInterface $containerConfig Search request container config.
@para... | [
"Rewrite",
"the",
"query",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Plugin/QueryRewrite.php#L74-L108 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Plugin/QueryRewrite.php | QueryRewrite.getWeightedRewrites | private function getWeightedRewrites($queryText, $containerConfig)
{
$rewrites = [];
if (!is_array($queryText)) {
$queryText = [$queryText];
}
foreach ($queryText as $currentQueryText) {
$rewrites = array_merge($rewrites, $this->index->getQueryRewrites($cont... | php | private function getWeightedRewrites($queryText, $containerConfig)
{
$rewrites = [];
if (!is_array($queryText)) {
$queryText = [$queryText];
}
foreach ($queryText as $currentQueryText) {
$rewrites = array_merge($rewrites, $this->index->getQueryRewrites($cont... | [
"private",
"function",
"getWeightedRewrites",
"(",
"$",
"queryText",
",",
"$",
"containerConfig",
")",
"{",
"$",
"rewrites",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"queryText",
")",
")",
"{",
"$",
"queryText",
"=",
"[",
"$",
"queryTe... | Get weighted rewrites for a given query text.
Returns an associative array of ['rewritten query' => weight] if any matches are found.
@param string|array $queryText The query text
@param ContainerConfigurationInterface $containerConfig Container Configuration
@return array | [
"Get",
"weighted",
"rewrites",
"for",
"a",
"given",
"query",
"text",
".",
"Returns",
"an",
"associative",
"array",
"of",
"[",
"rewritten",
"query",
"=",
">",
"weight",
"]",
"if",
"any",
"matches",
"are",
"found",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Plugin/QueryRewrite.php#L119-L132 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/RelevanceConfig/App/Config.php | Config.getValue | public function getValue(
$path = null,
$scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
$scopeCode = null
) {
return $this->scopePool->getScope($scope, $scopeCode)->getValue($path);
} | php | public function getValue(
$path = null,
$scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
$scopeCode = null
) {
return $this->scopePool->getScope($scope, $scopeCode)->getValue($path);
} | [
"public",
"function",
"getValue",
"(",
"$",
"path",
"=",
"null",
",",
"$",
"scope",
"=",
"ScopeConfigInterface",
"::",
"SCOPE_TYPE_DEFAULT",
",",
"$",
"scopeCode",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"scopePool",
"->",
"getScope",
"(",
"$",... | Retrieve config value by path and scope
@param string $path The path to retrieve config for
@param string $scope The scope
@param null|string $scopeCode The scope code, if any
@return mixed | [
"Retrieve",
"config",
"value",
"by",
"path",
"and",
"scope"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/RelevanceConfig/App/Config.php#L52-L58 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Category/Indexer/Fulltext.php | Fulltext.execute | public function execute($ids)
{
$storeIds = array_keys($this->storeManager->getStores());
foreach ($storeIds as $storeId) {
$dimension = $this->dimensionFactory->create(['name' => 'scope', 'value' => $storeId]);
$this->indexerHandler->deleteIndex([$dimension], new \ArrayObje... | php | public function execute($ids)
{
$storeIds = array_keys($this->storeManager->getStores());
foreach ($storeIds as $storeId) {
$dimension = $this->dimensionFactory->create(['name' => 'scope', 'value' => $storeId]);
$this->indexerHandler->deleteIndex([$dimension], new \ArrayObje... | [
"public",
"function",
"execute",
"(",
"$",
"ids",
")",
"{",
"$",
"storeIds",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"storeManager",
"->",
"getStores",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"storeIds",
"as",
"$",
"storeId",
")",
"{",
"$",
"dime... | Execute materialization on ids entities
@param int[] $ids The ids
@return void | [
"Execute",
"materialization",
"on",
"ids",
"entities"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Category/Indexer/Fulltext.php#L80-L89 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Category/Indexer/Fulltext.php | Fulltext.executeFull | public function executeFull()
{
$storeIds = array_keys($this->storeManager->getStores());
foreach ($storeIds as $storeId) {
$dimension = $this->dimensionFactory->create(['name' => 'scope', 'value' => $storeId]);
$this->indexerHandler->cleanIndex([$dimension]);
$t... | php | public function executeFull()
{
$storeIds = array_keys($this->storeManager->getStores());
foreach ($storeIds as $storeId) {
$dimension = $this->dimensionFactory->create(['name' => 'scope', 'value' => $storeId]);
$this->indexerHandler->cleanIndex([$dimension]);
$t... | [
"public",
"function",
"executeFull",
"(",
")",
"{",
"$",
"storeIds",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"storeManager",
"->",
"getStores",
"(",
")",
")",
";",
"foreach",
"(",
"$",
"storeIds",
"as",
"$",
"storeId",
")",
"{",
"$",
"dimension",
"=... | Execute full indexation
@return void | [
"Execute",
"full",
"indexation"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Category/Indexer/Fulltext.php#L96-L105 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/Indexer/IndexHandler.php | IndexHandler.reindex | public function reindex($storeId, $synonyms, $expansions)
{
$indexIdentifier = ThesaurusIndex::INDEX_IDENTIER;
$indexName = $this->indexSettingsHelper->createIndexNameFromIdentifier($indexIdentifier, $storeId);
$indexAlias = $this->indexSettingsHelper->getIndexAliasFromIdentifier(... | php | public function reindex($storeId, $synonyms, $expansions)
{
$indexIdentifier = ThesaurusIndex::INDEX_IDENTIER;
$indexName = $this->indexSettingsHelper->createIndexNameFromIdentifier($indexIdentifier, $storeId);
$indexAlias = $this->indexSettingsHelper->getIndexAliasFromIdentifier(... | [
"public",
"function",
"reindex",
"(",
"$",
"storeId",
",",
"$",
"synonyms",
",",
"$",
"expansions",
")",
"{",
"$",
"indexIdentifier",
"=",
"ThesaurusIndex",
"::",
"INDEX_IDENTIER",
";",
"$",
"indexName",
"=",
"$",
"this",
"->",
"indexSettingsHelper",
"->",
"... | Create the synonyms index for a store id.
@param integer $storeId Store id.
@param string[] $synonyms Raw synonyms list.
@param string[] $expansions Raw expansions list.
@return void | [
"Create",
"the",
"synonyms",
"index",
"for",
"a",
"store",
"id",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/Indexer/IndexHandler.php#L81-L90 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/Indexer/IndexHandler.php | IndexHandler.getIndexSettings | private function getIndexSettings($synonyms, $expansions)
{
$settings = [
'number_of_shards' => $this->indexSettingsHelper->getNumberOfShards(),
'number_of_replicas' => $this->indexSettingsHelper->getNumberOfReplicas(),
'requests.cache.enable' => true,
];
... | php | private function getIndexSettings($synonyms, $expansions)
{
$settings = [
'number_of_shards' => $this->indexSettingsHelper->getNumberOfShards(),
'number_of_replicas' => $this->indexSettingsHelper->getNumberOfReplicas(),
'requests.cache.enable' => true,
];
... | [
"private",
"function",
"getIndexSettings",
"(",
"$",
"synonyms",
",",
"$",
"expansions",
")",
"{",
"$",
"settings",
"=",
"[",
"'number_of_shards'",
"=>",
"$",
"this",
"->",
"indexSettingsHelper",
"->",
"getNumberOfShards",
"(",
")",
",",
"'number_of_replicas'",
... | Returns index settings.
@param string[] $synonyms Raw synonyms list.
@param string[] $expansions Raw expansions list.
@return array | [
"Returns",
"index",
"settings",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/Indexer/IndexHandler.php#L100-L124 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/Indexer/IndexHandler.php | IndexHandler.addAnalyzerSettings | private function addAnalyzerSettings($settings, $type, $values)
{
$settings['analysis']['analyzer'][$type] = [
'tokenizer' => 'whitespace',
'filter' => ['lowercase', 'shingle'],
];
if (!empty($values)) {
$values = $this->prepareSynonymFilterData($values);... | php | private function addAnalyzerSettings($settings, $type, $values)
{
$settings['analysis']['analyzer'][$type] = [
'tokenizer' => 'whitespace',
'filter' => ['lowercase', 'shingle'],
];
if (!empty($values)) {
$values = $this->prepareSynonymFilterData($values);... | [
"private",
"function",
"addAnalyzerSettings",
"(",
"$",
"settings",
",",
"$",
"type",
",",
"$",
"values",
")",
"{",
"$",
"settings",
"[",
"'analysis'",
"]",
"[",
"'analyzer'",
"]",
"[",
"$",
"type",
"]",
"=",
"[",
"'tokenizer'",
"=>",
"'whitespace'",
","... | Append an analyzer for a thesaurus to existing settings.
@param array $settings Original settings.
@param string $type Thesaurus type.
@param string[] $values Thesaurus entries in Lucene format.
@return array | [
"Append",
"an",
"analyzer",
"for",
"a",
"thesaurus",
"to",
"existing",
"settings",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/Indexer/IndexHandler.php#L135-L151 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Setup/RecurringData.php | RecurringData.install | public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$this->configHash->regenerate();
$setup->endSetup();
} | php | public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$this->configHash->regenerate();
$setup->endSetup();
} | [
"public",
"function",
"install",
"(",
"ModuleDataSetupInterface",
"$",
"setup",
",",
"ModuleContextInterface",
"$",
"context",
")",
"{",
"$",
"setup",
"->",
"startSetup",
"(",
")",
";",
"$",
"this",
"->",
"configHash",
"->",
"regenerate",
"(",
")",
";",
"$",... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Setup/RecurringData.php#L48-L55 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Setup/UpgradeData.php | UpgradeData.upgrade | public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
if (version_compare($context->getVersion(), "1.2.0") < 0) {
$this->optimizerSetup->convertSerializedRulesToJson($setup);
}
$setup->endSetup();
} | php | public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
if (version_compare($context->getVersion(), "1.2.0") < 0) {
$this->optimizerSetup->convertSerializedRulesToJson($setup);
}
$setup->endSetup();
} | [
"public",
"function",
"upgrade",
"(",
"ModuleDataSetupInterface",
"$",
"setup",
",",
"ModuleContextInterface",
"$",
"context",
")",
"{",
"$",
"setup",
"->",
"startSetup",
"(",
")",
";",
"if",
"(",
"version_compare",
"(",
"$",
"context",
"->",
"getVersion",
"("... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Setup/UpgradeData.php#L46-L53 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer/Collection.php | Collection.setStoreId | public function setStoreId($store)
{
if ($store instanceof Store) {
$store = $store->getId();
}
$this->storeId = $store;
return $this;
} | php | public function setStoreId($store)
{
if ($store instanceof Store) {
$store = $store->getId();
}
$this->storeId = $store;
return $this;
} | [
"public",
"function",
"setStoreId",
"(",
"$",
"store",
")",
"{",
"if",
"(",
"$",
"store",
"instanceof",
"Store",
")",
"{",
"$",
"store",
"=",
"$",
"store",
"->",
"getId",
"(",
")",
";",
"}",
"$",
"this",
"->",
"storeId",
"=",
"$",
"store",
";",
"... | Set Store ID for filter
@param Store|int $store The store.
@return $this | [
"Set",
"Store",
"ID",
"for",
"filter"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer/Collection.php#L74-L82 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer/Collection.php | Collection.addSearchContainersFilter | public function addSearchContainersFilter($searchContainers)
{
if (!is_array($searchContainers)) {
$searchContainers = [$searchContainers];
}
$cond = OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER. '.'
. OptimizerInterface::OPTIMIZER_ID
.' = main_table.... | php | public function addSearchContainersFilter($searchContainers)
{
if (!is_array($searchContainers)) {
$searchContainers = [$searchContainers];
}
$cond = OptimizerInterface::TABLE_NAME_SEARCH_CONTAINER. '.'
. OptimizerInterface::OPTIMIZER_ID
.' = main_table.... | [
"public",
"function",
"addSearchContainersFilter",
"(",
"$",
"searchContainers",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"searchContainers",
")",
")",
"{",
"$",
"searchContainers",
"=",
"[",
"$",
"searchContainers",
"]",
";",
"}",
"$",
"cond",
"=",
... | Add search containers filer.
@param string $searchContainers Search containers.
@return \Smile\ElasticsuiteCatalogOptimizer\Model\ResourceModel\Optimizer\Collection | [
"Add",
"search",
"containers",
"filer",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer/Collection.php#L101-L116 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer/Collection.php | Collection.addIsActiveFilter | public function addIsActiveFilter($date = null)
{
$this->addFieldToFilter('is_active', true);
if ($date == null) {
$date = $this->date->date('Y-m-d');
}
$this->getSelect()
->where('from_date is null or from_date <= ?', $date)
->where('to_date is ... | php | public function addIsActiveFilter($date = null)
{
$this->addFieldToFilter('is_active', true);
if ($date == null) {
$date = $this->date->date('Y-m-d');
}
$this->getSelect()
->where('from_date is null or from_date <= ?', $date)
->where('to_date is ... | [
"public",
"function",
"addIsActiveFilter",
"(",
"$",
"date",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"addFieldToFilter",
"(",
"'is_active'",
",",
"true",
")",
";",
"if",
"(",
"$",
"date",
"==",
"null",
")",
"{",
"$",
"date",
"=",
"$",
"this",
"->",... | Returns only active optimizers.
@param string $date Date the filter need to be active (UTC).
@return \Smile\ElasticsuiteCatalogOptimizer\Model\ResourceModel\Optimizer\Collection | [
"Returns",
"only",
"active",
"optimizers",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer/Collection.php#L125-L138 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Navigation/Renderer/Slider.php | Slider.getFieldFormat | protected function getFieldFormat()
{
$format = $this->localeFormat->getPriceFormat();
$attribute = $this->getFilter()->getAttributeModel();
$format['pattern'] = (string) $attribute->getDisplayPattern();
$format['precision'] = (int) $attribute->getDisplayPrecision... | php | protected function getFieldFormat()
{
$format = $this->localeFormat->getPriceFormat();
$attribute = $this->getFilter()->getAttributeModel();
$format['pattern'] = (string) $attribute->getDisplayPattern();
$format['precision'] = (int) $attribute->getDisplayPrecision... | [
"protected",
"function",
"getFieldFormat",
"(",
")",
"{",
"$",
"format",
"=",
"$",
"this",
"->",
"localeFormat",
"->",
"getPriceFormat",
"(",
")",
";",
"$",
"attribute",
"=",
"$",
"this",
"->",
"getFilter",
"(",
")",
"->",
"getAttributeModel",
"(",
")",
... | Retrieve Field Format for slider display
@return array | [
"Retrieve",
"Field",
"Format",
"for",
"slider",
"display"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/Renderer/Slider.php#L109-L121 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Navigation/Renderer/Slider.php | Slider.getConfig | protected function getConfig()
{
$config = [
'minValue' => $this->getMinValue(),
'maxValue' => $this->getMaxValue(),
'currentValue' => $this->getCurrentValue(),
'fieldFormat' => $this->getFieldFormat(),
'intervals' =... | php | protected function getConfig()
{
$config = [
'minValue' => $this->getMinValue(),
'maxValue' => $this->getMaxValue(),
'currentValue' => $this->getCurrentValue(),
'fieldFormat' => $this->getFieldFormat(),
'intervals' =... | [
"protected",
"function",
"getConfig",
"(",
")",
"{",
"$",
"config",
"=",
"[",
"'minValue'",
"=>",
"$",
"this",
"->",
"getMinValue",
"(",
")",
",",
"'maxValue'",
"=>",
"$",
"this",
"->",
"getMaxValue",
"(",
")",
",",
"'currentValue'",
"=>",
"$",
"this",
... | Retrieve configuration
@return array | [
"Retrieve",
"configuration"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/Renderer/Slider.php#L128-L144 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Navigation/Renderer/Slider.php | Slider.getCurrentValue | private function getCurrentValue()
{
$currentValue = $this->getFilter()->getCurrentValue();
if (!is_array($currentValue)) {
$currentValue = [];
}
if (!isset($currentValue['from']) || $currentValue['from'] === '') {
$currentValue['from'] = $this->getMinValue(... | php | private function getCurrentValue()
{
$currentValue = $this->getFilter()->getCurrentValue();
if (!is_array($currentValue)) {
$currentValue = [];
}
if (!isset($currentValue['from']) || $currentValue['from'] === '') {
$currentValue['from'] = $this->getMinValue(... | [
"private",
"function",
"getCurrentValue",
"(",
")",
"{",
"$",
"currentValue",
"=",
"$",
"this",
"->",
"getFilter",
"(",
")",
"->",
"getCurrentValue",
"(",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"currentValue",
")",
")",
"{",
"$",
"currentValue",... | Returns values currently selected by the user.
@return array | [
"Returns",
"values",
"currently",
"selected",
"by",
"the",
"user",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/Renderer/Slider.php#L171-L188 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Navigation/Renderer/Slider.php | Slider.getIntervals | private function getIntervals()
{
$intervals = [];
foreach ($this->getFilter()->getItems() as $item) {
$intervals[] = ['value' => $item->getValue(), 'count' => $item->getCount()];
}
return $intervals;
} | php | private function getIntervals()
{
$intervals = [];
foreach ($this->getFilter()->getItems() as $item) {
$intervals[] = ['value' => $item->getValue(), 'count' => $item->getCount()];
}
return $intervals;
} | [
"private",
"function",
"getIntervals",
"(",
")",
"{",
"$",
"intervals",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getFilter",
"(",
")",
"->",
"getItems",
"(",
")",
"as",
"$",
"item",
")",
"{",
"$",
"intervals",
"[",
"]",
"=",
"[",
"... | Return available intervals.
@return array | [
"Return",
"available",
"intervals",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/Renderer/Slider.php#L195-L204 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Navigation/Renderer/Slider.php | Slider.getUrlTemplate | private function getUrlTemplate()
{
$filter = $this->getFilter();
$item = current($this->getFilter()->getItems());
$regexp = "/({$filter->getRequestVar()})=(-?[0-9]+)/";
$replacement = '${1}=<%- from %>-<%- to %>';
return preg_replace($regexp, $replacement, $item->ge... | php | private function getUrlTemplate()
{
$filter = $this->getFilter();
$item = current($this->getFilter()->getItems());
$regexp = "/({$filter->getRequestVar()})=(-?[0-9]+)/";
$replacement = '${1}=<%- from %>-<%- to %>';
return preg_replace($regexp, $replacement, $item->ge... | [
"private",
"function",
"getUrlTemplate",
"(",
")",
"{",
"$",
"filter",
"=",
"$",
"this",
"->",
"getFilter",
"(",
")",
";",
"$",
"item",
"=",
"current",
"(",
"$",
"this",
"->",
"getFilter",
"(",
")",
"->",
"getItems",
"(",
")",
")",
";",
"$",
"regex... | Retrieve filter URL template with placeholders for range.
@return string | [
"Retrieve",
"filter",
"URL",
"template",
"with",
"placeholders",
"for",
"range",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/Renderer/Slider.php#L211-L220 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Setup/CoreSetup.php | CoreSetup.createRelevanceConfigTable | public function createRelevanceConfigTable(SchemaSetupInterface $setup)
{
$connection = $setup->getConnection();
/**
* Create table 'smile_elasticsuite_relevance_config_data'
*/
$table = $connection->newTable(
$setup->getTable('smile_elasticsuite_relevance_conf... | php | public function createRelevanceConfigTable(SchemaSetupInterface $setup)
{
$connection = $setup->getConnection();
/**
* Create table 'smile_elasticsuite_relevance_config_data'
*/
$table = $connection->newTable(
$setup->getTable('smile_elasticsuite_relevance_conf... | [
"public",
"function",
"createRelevanceConfigTable",
"(",
"SchemaSetupInterface",
"$",
"setup",
")",
"{",
"$",
"connection",
"=",
"$",
"setup",
"->",
"getConnection",
"(",
")",
";",
"/**\n * Create table 'smile_elasticsuite_relevance_config_data'\n */",
"$",
... | Create Relevance Config table.
@param \Magento\Framework\Setup\SchemaSetupInterface $setup Setup Interface | [
"Create",
"Relevance",
"Config",
"table",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Setup/CoreSetup.php#L32-L83 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Bulk/BulkResponse.php | BulkResponse.getErrorItems | public function getErrorItems()
{
$errors = array_filter($this->rawResponse['items'], function ($item) {
return isset(current($item)['error']);
});
return $errors;
} | php | public function getErrorItems()
{
$errors = array_filter($this->rawResponse['items'], function ($item) {
return isset(current($item)['error']);
});
return $errors;
} | [
"public",
"function",
"getErrorItems",
"(",
")",
"{",
"$",
"errors",
"=",
"array_filter",
"(",
"$",
"this",
"->",
"rawResponse",
"[",
"'items'",
"]",
",",
"function",
"(",
"$",
"item",
")",
"{",
"return",
"isset",
"(",
"current",
"(",
"$",
"item",
")",... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Bulk/BulkResponse.php#L54-L61 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Bulk/BulkResponse.php | BulkResponse.getSuccessItems | public function getSuccessItems()
{
$successes = array_filter($this->rawResponse['items'], function ($item) {
return !isset(current($item)['error']);
});
return $successes;
} | php | public function getSuccessItems()
{
$successes = array_filter($this->rawResponse['items'], function ($item) {
return !isset(current($item)['error']);
});
return $successes;
} | [
"public",
"function",
"getSuccessItems",
"(",
")",
"{",
"$",
"successes",
"=",
"array_filter",
"(",
"$",
"this",
"->",
"rawResponse",
"[",
"'items'",
"]",
",",
"function",
"(",
"$",
"item",
")",
"{",
"return",
"!",
"isset",
"(",
"current",
"(",
"$",
"i... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Bulk/BulkResponse.php#L66-L73 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Bulk/BulkResponse.php | BulkResponse.aggregateErrorsByReason | public function aggregateErrorsByReason()
{
$errorByReason = [];
foreach ($this->getErrorItems() as $item) {
$operationType = current(array_keys($item));
$itemData = $item[$operationType];
$index = $itemData['_index'];
$documentType = $i... | php | public function aggregateErrorsByReason()
{
$errorByReason = [];
foreach ($this->getErrorItems() as $item) {
$operationType = current(array_keys($item));
$itemData = $item[$operationType];
$index = $itemData['_index'];
$documentType = $i... | [
"public",
"function",
"aggregateErrorsByReason",
"(",
")",
"{",
"$",
"errorByReason",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getErrorItems",
"(",
")",
"as",
"$",
"item",
")",
"{",
"$",
"operationType",
"=",
"current",
"(",
"array_keys",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Bulk/BulkResponse.php#L94-L121 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Indexer/Stock/ReindexProductsAfterStockUpdate.php | ReindexProductsAfterStockUpdate.aroundExecute | public function aroundExecute(
\Magento\CatalogInventory\Model\Indexer\Stock $subject,
\Closure $proceed,
$productIds
) {
$proceed($productIds);
$this->processFullTextIndex($productIds);
return;
} | php | public function aroundExecute(
\Magento\CatalogInventory\Model\Indexer\Stock $subject,
\Closure $proceed,
$productIds
) {
$proceed($productIds);
$this->processFullTextIndex($productIds);
return;
} | [
"public",
"function",
"aroundExecute",
"(",
"\\",
"Magento",
"\\",
"CatalogInventory",
"\\",
"Model",
"\\",
"Indexer",
"\\",
"Stock",
"$",
"subject",
",",
"\\",
"Closure",
"$",
"proceed",
",",
"$",
"productIds",
")",
"{",
"$",
"proceed",
"(",
"$",
"product... | @SuppressWarnings(PHPMD.UnusedFormalParameter)
Process row indexation into ES after the precedent stock index
@param \Magento\CatalogInventory\Model\Indexer\Stock $subject The CatalogInventory indexer
@param \Closure $proceed The ::execute() function of $subject
@param int[]... | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"UnusedFormalParameter",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Indexer/Stock/ReindexProductsAfterStockUpdate.php#L40-L50 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Indexer/Stock/ReindexProductsAfterStockUpdate.php | ReindexProductsAfterStockUpdate.aroundExecuteRow | public function aroundExecuteRow(
\Magento\CatalogInventory\Model\Indexer\Stock $subject,
\Closure $proceed,
$productId
) {
$proceed($productId);
$this->processFullTextIndex($productId);
return;
} | php | public function aroundExecuteRow(
\Magento\CatalogInventory\Model\Indexer\Stock $subject,
\Closure $proceed,
$productId
) {
$proceed($productId);
$this->processFullTextIndex($productId);
return;
} | [
"public",
"function",
"aroundExecuteRow",
"(",
"\\",
"Magento",
"\\",
"CatalogInventory",
"\\",
"Model",
"\\",
"Indexer",
"\\",
"Stock",
"$",
"subject",
",",
"\\",
"Closure",
"$",
"proceed",
",",
"$",
"productId",
")",
"{",
"$",
"proceed",
"(",
"$",
"produ... | @SuppressWarnings(PHPMD.UnusedFormalParameter)
Process row indexation into ES after the precedent stock index
@param \Magento\CatalogInventory\Model\Indexer\Stock $subject The CatalogInventory indexer
@param \Closure $proceed The ::executeRow() function of $subject
@param int ... | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"UnusedFormalParameter",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Indexer/Stock/ReindexProductsAfterStockUpdate.php#L63-L73 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/OptimizerRepository.php | OptimizerRepository.getById | public function getById($optimizerId)
{
if (!isset($this->optimizerRepositoryById[$optimizerId])) {
$optimizerModel = $this->optimizerFactory->create();
$optimizer = $this->entityManager->load($optimizerModel, $optimizerId);
if (!$optimizer->getId()) {
thr... | php | public function getById($optimizerId)
{
if (!isset($this->optimizerRepositoryById[$optimizerId])) {
$optimizerModel = $this->optimizerFactory->create();
$optimizer = $this->entityManager->load($optimizerModel, $optimizerId);
if (!$optimizer->getId()) {
thr... | [
"public",
"function",
"getById",
"(",
"$",
"optimizerId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"optimizerRepositoryById",
"[",
"$",
"optimizerId",
"]",
")",
")",
"{",
"$",
"optimizerModel",
"=",
"$",
"this",
"->",
"optimizerFactory",
... | Retrieve a optimizer by its ID
@SuppressWarnings(PHPMD.StaticAccess) Mandatory to throw the exception via static access to be compliant
with Magento Extension Quality Program
@param int $optimizerId Id of the optimizer.
@return \Smile\ElasticsuiteCatalogOptimizer\Api\Data\OptimizerInterface
@throws \Magento\Framewor... | [
"Retrieve",
"a",
"optimizer",
"by",
"its",
"ID"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/OptimizerRepository.php#L85-L98 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/OptimizerRepository.php | OptimizerRepository.save | public function save(\Smile\ElasticsuiteCatalogOptimizer\Api\Data\OptimizerInterface $optimizer)
{
try {
$this->entityManager->save($optimizer);
} catch (\Exception $exception) {
throw new CouldNotSaveException(__(
'Could not save the optimizer: %1',
... | php | public function save(\Smile\ElasticsuiteCatalogOptimizer\Api\Data\OptimizerInterface $optimizer)
{
try {
$this->entityManager->save($optimizer);
} catch (\Exception $exception) {
throw new CouldNotSaveException(__(
'Could not save the optimizer: %1',
... | [
"public",
"function",
"save",
"(",
"\\",
"Smile",
"\\",
"ElasticsuiteCatalogOptimizer",
"\\",
"Api",
"\\",
"Data",
"\\",
"OptimizerInterface",
"$",
"optimizer",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"entityManager",
"->",
"save",
"(",
"$",
"optimizer",
")... | save a optimizer
@param \Smile\ElasticsuiteCatalogOptimizer\Api\Data\OptimizerInterface $optimizer Optimizer
@return \Smile\ElasticsuiteCatalogOptimizer\Api\Data\OptimizerInterface
@throws \Magento\Framework\Exception\CouldNotSaveException | [
"save",
"a",
"optimizer"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/OptimizerRepository.php#L121-L135 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/OptimizerRepository.php | OptimizerRepository.delete | public function delete(\Smile\ElasticsuiteCatalogOptimizer\Api\Data\OptimizerInterface $optimizer)
{
$optimizerId = $optimizer->getId();
$this->entityManager->delete($optimizer);
if (isset($this->optimizerRepositoryById[$optimizerId])) {
unset($this->optimizerRepositoryById[$op... | php | public function delete(\Smile\ElasticsuiteCatalogOptimizer\Api\Data\OptimizerInterface $optimizer)
{
$optimizerId = $optimizer->getId();
$this->entityManager->delete($optimizer);
if (isset($this->optimizerRepositoryById[$optimizerId])) {
unset($this->optimizerRepositoryById[$op... | [
"public",
"function",
"delete",
"(",
"\\",
"Smile",
"\\",
"ElasticsuiteCatalogOptimizer",
"\\",
"Api",
"\\",
"Data",
"\\",
"OptimizerInterface",
"$",
"optimizer",
")",
"{",
"$",
"optimizerId",
"=",
"$",
"optimizer",
"->",
"getId",
"(",
")",
";",
"$",
"this",... | delete a optimizer
@param \Smile\ElasticsuiteCatalogOptimizer\Api\Data\OptimizerInterface $optimizer Optimizer
@return \Smile\ElasticsuiteCatalogOptimizer\Api\Data\OptimizerInterface
@throws \Magento\Framework\Exception\NoSuchEntityException | [
"delete",
"a",
"optimizer"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/OptimizerRepository.php#L145-L156 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Autocomplete/Product/Collection/Provider.php | Provider.prepareProductCollection | private function prepareProductCollection(ProductCollection $collection)
{
foreach ($this->collectionProcessors as $processor) {
$collection = $processor->prepareCollection($collection);
}
return $collection;
} | php | private function prepareProductCollection(ProductCollection $collection)
{
foreach ($this->collectionProcessors as $processor) {
$collection = $processor->prepareCollection($collection);
}
return $collection;
} | [
"private",
"function",
"prepareProductCollection",
"(",
"ProductCollection",
"$",
"collection",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"collectionProcessors",
"as",
"$",
"processor",
")",
"{",
"$",
"collection",
"=",
"$",
"processor",
"->",
"prepareCollectio... | Init suggested products collection.
@param ProductCollection $collection Product collection
@return ProductCollection | [
"Init",
"suggested",
"products",
"collection",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Product/Collection/Provider.php#L67-L74 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Controller/Adminhtml/Term/Merchandiser/Edit.php | Edit.execute | public function execute()
{
$queryId = $this->getRequest()->getParam('id');
$model = $this->queryFactory->create();
$result = null;
if (!$queryId) {
$this->messageManager->addErrorMessage(__('No search specified.'));
$result = $this->resultFactory->create(... | php | public function execute()
{
$queryId = $this->getRequest()->getParam('id');
$model = $this->queryFactory->create();
$result = null;
if (!$queryId) {
$this->messageManager->addErrorMessage(__('No search specified.'));
$result = $this->resultFactory->create(... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"queryId",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",
"'id'",
")",
";",
"$",
"model",
"=",
"$",
"this",
"->",
"queryFactory",
"->",
"create",
"(",
")",
";",
"$",
"resu... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Controller/Adminhtml/Term/Merchandiser/Edit.php#L59-L83 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/AbstractOptimizer.php | AbstractOptimizer.createPage | protected function createPage()
{
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->setActiveMenu('Smile_ElasticsuiteCatalogOptimizer::optimizer')
->addBreadcrumb(__('Optimizer'), __('Optimizer'));
... | php | protected function createPage()
{
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->setActiveMenu('Smile_ElasticsuiteCatalogOptimizer::optimizer')
->addBreadcrumb(__('Optimizer'), __('Optimizer'));
... | [
"protected",
"function",
"createPage",
"(",
")",
"{",
"/** @var \\Magento\\Backend\\Model\\View\\Result\\Page $resultPage */",
"$",
"resultPage",
"=",
"$",
"this",
"->",
"resultPageFactory",
"->",
"create",
"(",
")",
";",
"$",
"resultPage",
"->",
"setActiveMenu",
"(",
... | Create result page
@return \Magento\Backend\Model\View\Result\Page | [
"Create",
"result",
"page"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/AbstractOptimizer.php#L80-L89 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Indexer/Price/ReindexProductsAfterPriceUpdate.php | ReindexProductsAfterPriceUpdate.aroundExecute | public function aroundExecute(
\Magento\Catalog\Model\Indexer\Product\Price $subject,
\Closure $proceed,
$productIds
) {
$proceed($productIds);
$this->processFullTextIndex($productIds);
return;
} | php | public function aroundExecute(
\Magento\Catalog\Model\Indexer\Product\Price $subject,
\Closure $proceed,
$productIds
) {
$proceed($productIds);
$this->processFullTextIndex($productIds);
return;
} | [
"public",
"function",
"aroundExecute",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Indexer",
"\\",
"Product",
"\\",
"Price",
"$",
"subject",
",",
"\\",
"Closure",
"$",
"proceed",
",",
"$",
"productIds",
")",
"{",
"$",
"proceed",
"(",
"$"... | @SuppressWarnings(PHPMD.UnusedFormalParameter)
Process row indexation into ES after the precedent stock index
@param \Magento\Catalog\Model\Indexer\Product\Price $subject The Price indexer
@param \Closure $proceed The ::execute() function of $subject
@param int[] ... | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"UnusedFormalParameter",
")",
"Process",
"row",
"indexation",
"into",
"ES",
"after",
"the",
"precedent",
"stock",
"index"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Indexer/Price/ReindexProductsAfterPriceUpdate.php#L39-L49 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Indexer/Price/ReindexProductsAfterPriceUpdate.php | ReindexProductsAfterPriceUpdate.aroundExecuteRow | public function aroundExecuteRow(
\Magento\Catalog\Model\Indexer\Product\Price $subject,
\Closure $proceed,
$productId
) {
$proceed($productId);
$this->processFullTextIndex($productId);
return;
} | php | public function aroundExecuteRow(
\Magento\Catalog\Model\Indexer\Product\Price $subject,
\Closure $proceed,
$productId
) {
$proceed($productId);
$this->processFullTextIndex($productId);
return;
} | [
"public",
"function",
"aroundExecuteRow",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Indexer",
"\\",
"Product",
"\\",
"Price",
"$",
"subject",
",",
"\\",
"Closure",
"$",
"proceed",
",",
"$",
"productId",
")",
"{",
"$",
"proceed",
"(",
"... | @SuppressWarnings(PHPMD.UnusedFormalParameter)
Process row indexation into ES after the precedent stock index
@param \Magento\Catalog\Model\Indexer\Product\Price $subject The Price indexer
@param \Closure $proceed The ::executeRow() function of $subject
@param int ... | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"UnusedFormalParameter",
")",
"Process",
"row",
"indexation",
"into",
"ES",
"after",
"the",
"precedent",
"stock",
"index"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Indexer/Price/ReindexProductsAfterPriceUpdate.php#L61-L71 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Ui/Component/Search/Term/Preview/DataProvider.php | DataProvider.getData | public function getData()
{
$data = parent::getData();
$items = [];
foreach ($data['items'] as $currentItem) {
$queryId = $currentItem[$this->primaryFieldName];
$currentItem['sorted_products'] = json_encode($this->getSortedProducts($queryId), JSON_FORCE_OBJEC... | php | public function getData()
{
$data = parent::getData();
$items = [];
foreach ($data['items'] as $currentItem) {
$queryId = $currentItem[$this->primaryFieldName];
$currentItem['sorted_products'] = json_encode($this->getSortedProducts($queryId), JSON_FORCE_OBJEC... | [
"public",
"function",
"getData",
"(",
")",
"{",
"$",
"data",
"=",
"parent",
"::",
"getData",
"(",
")",
";",
"$",
"items",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"[",
"'items'",
"]",
"as",
"$",
"currentItem",
")",
"{",
"$",
"queryId",
"=... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Ui/Component/Search/Term/Preview/DataProvider.php#L76-L91 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Helper/Cache.php | Cache.saveCache | public function saveCache($cacheKey, $data, $cacheTags = [], $lifetime = self::DEFAULT_LIFETIME)
{
$this->localCache[$cacheKey] = $data;
if (!is_string($data)) {
$data = serialize($data);
}
$this->cache->save($data, $cacheKey, $cacheTags, $lifetime);
} | php | public function saveCache($cacheKey, $data, $cacheTags = [], $lifetime = self::DEFAULT_LIFETIME)
{
$this->localCache[$cacheKey] = $data;
if (!is_string($data)) {
$data = serialize($data);
}
$this->cache->save($data, $cacheKey, $cacheTags, $lifetime);
} | [
"public",
"function",
"saveCache",
"(",
"$",
"cacheKey",
",",
"$",
"data",
",",
"$",
"cacheTags",
"=",
"[",
"]",
",",
"$",
"lifetime",
"=",
"self",
"::",
"DEFAULT_LIFETIME",
")",
"{",
"$",
"this",
"->",
"localCache",
"[",
"$",
"cacheKey",
"]",
"=",
"... | Save some data into an index cache.
@param string $cacheKey Cache key.
@param mixed $data Data.
@param string[] $cacheTags Cache tags.
@param integer $lifetime Cache lifetime. | [
"Save",
"some",
"data",
"into",
"an",
"index",
"cache",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Helper/Cache.php#L71-L80 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Helper/Cache.php | Cache.loadCache | public function loadCache($cacheKey)
{
if (!isset($this->localCache[$cacheKey])) {
$data = $this->cache->load($cacheKey);
if ($data) {
$data = unserialize($data);
}
$this->localCache[$cacheKey] = $data;
}
return $this->localC... | php | public function loadCache($cacheKey)
{
if (!isset($this->localCache[$cacheKey])) {
$data = $this->cache->load($cacheKey);
if ($data) {
$data = unserialize($data);
}
$this->localCache[$cacheKey] = $data;
}
return $this->localC... | [
"public",
"function",
"loadCache",
"(",
"$",
"cacheKey",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"localCache",
"[",
"$",
"cacheKey",
"]",
")",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"cache",
"->",
"load",
"(",
"$",
"cac... | Load data from the cache
@param string $cacheKey Cache key.
@return mixed | [
"Load",
"data",
"from",
"the",
"cache"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Helper/Cache.php#L89-L102 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Helper/Cache.php | Cache.cleanIndexCache | public function cleanIndexCache($indexIdentifier, $storeId)
{
$cacheTags = $this->getCacheTags($indexIdentifier, $storeId);
$this->localCache = [];
$this->cache->clean($cacheTags);
} | php | public function cleanIndexCache($indexIdentifier, $storeId)
{
$cacheTags = $this->getCacheTags($indexIdentifier, $storeId);
$this->localCache = [];
$this->cache->clean($cacheTags);
} | [
"public",
"function",
"cleanIndexCache",
"(",
"$",
"indexIdentifier",
",",
"$",
"storeId",
")",
"{",
"$",
"cacheTags",
"=",
"$",
"this",
"->",
"getCacheTags",
"(",
"$",
"indexIdentifier",
",",
"$",
"storeId",
")",
";",
"$",
"this",
"->",
"localCache",
"=",... | Clean the cache by index identifier and store.
@param string $indexIdentifier Index identifier.
@param string $storeId Store id.
@return void | [
"Clean",
"the",
"cache",
"by",
"index",
"identifier",
"and",
"store",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Helper/Cache.php#L112-L117 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Block/Adminhtml/Report/DateRangeSwitcher.php | DateRangeSwitcher.getJsConfig | public function getJsConfig()
{
$config = [
'dateFormat' => $this->getDateFormat(),
'from' => ['id' => $this->getJsId('date-range-picker', 'from')],
'to' => ['id' => $this->getJsId('date-range-picker', 'to')],
];
$dateBounds = $this->indexMa... | php | public function getJsConfig()
{
$config = [
'dateFormat' => $this->getDateFormat(),
'from' => ['id' => $this->getJsId('date-range-picker', 'from')],
'to' => ['id' => $this->getJsId('date-range-picker', 'to')],
];
$dateBounds = $this->indexMa... | [
"public",
"function",
"getJsConfig",
"(",
")",
"{",
"$",
"config",
"=",
"[",
"'dateFormat'",
"=>",
"$",
"this",
"->",
"getDateFormat",
"(",
")",
",",
"'from'",
"=>",
"[",
"'id'",
"=>",
"$",
"this",
"->",
"getJsId",
"(",
"'date-range-picker'",
",",
"'from... | Get JS config
@return bool|string | [
"Get",
"JS",
"config"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Block/Adminhtml/Report/DateRangeSwitcher.php#L93-L112 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php | AbstractAttributeData.addIndexedFilterToAttributeCollection | public function addIndexedFilterToAttributeCollection(AttributeCollection $attributeCollection)
{
$conditions = [];
foreach ($this->indexedAttributesConditions as $fieldName => $condition) {
if ($condition['operator'] == 'IN' || is_array($condition['value'])) {
$conditio... | php | public function addIndexedFilterToAttributeCollection(AttributeCollection $attributeCollection)
{
$conditions = [];
foreach ($this->indexedAttributesConditions as $fieldName => $condition) {
if ($condition['operator'] == 'IN' || is_array($condition['value'])) {
$conditio... | [
"public",
"function",
"addIndexedFilterToAttributeCollection",
"(",
"AttributeCollection",
"$",
"attributeCollection",
")",
"{",
"$",
"conditions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"indexedAttributesConditions",
"as",
"$",
"fieldName",
"=>",
"$... | Allow to filter an attribute collection on attributes that are indexed into the search engine.
@param AttributeCollection $attributeCollection Attribute collection (not loaded).
@return AttributeCollection | [
"Allow",
"to",
"filter",
"an",
"attribute",
"collection",
"on",
"attributes",
"that",
"are",
"indexed",
"into",
"the",
"search",
"engine",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php#L74-L93 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php | AbstractAttributeData.getAttributesRawData | public function getAttributesRawData($storeId, array $entityIds, $tableName, array $attributeIds)
{
$select = $this->connection->select();
// The field modelizing the link between entity table and attribute values table. Either row_id or entity_id.
$linkField = $this->getEntityMetaData($thi... | php | public function getAttributesRawData($storeId, array $entityIds, $tableName, array $attributeIds)
{
$select = $this->connection->select();
// The field modelizing the link between entity table and attribute values table. Either row_id or entity_id.
$linkField = $this->getEntityMetaData($thi... | [
"public",
"function",
"getAttributesRawData",
"(",
"$",
"storeId",
",",
"array",
"$",
"entityIds",
",",
"$",
"tableName",
",",
"array",
"$",
"attributeIds",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"connection",
"->",
"select",
"(",
")",
";",
"//... | Load attribute data for a list of entity ids.
@param int $storeId Store id.
@param array $entityIds Entity ids.
@param string $tableName Attribute table.
@param array $attributeIds Attribute ids to get loaded.
@return array | [
"Load",
"attribute",
"data",
"for",
"a",
"list",
"of",
"entity",
"ids",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php#L105-L139 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Layer/Filter/Category.php | Category.apply | public function apply(\Magento\Framework\App\RequestInterface $request)
{
$categoryId = $request->getParam($this->_requestVar) ? : $request->getParam('id');
if (!empty($categoryId)) {
$this->dataProvider->setCategoryId($categoryId);
$category = $this->dataProvider->getCateg... | php | public function apply(\Magento\Framework\App\RequestInterface $request)
{
$categoryId = $request->getParam($this->_requestVar) ? : $request->getParam('id');
if (!empty($categoryId)) {
$this->dataProvider->setCategoryId($categoryId);
$category = $this->dataProvider->getCateg... | [
"public",
"function",
"apply",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"App",
"\\",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"categoryId",
"=",
"$",
"request",
"->",
"getParam",
"(",
"$",
"this",
"->",
"_requestVar",
")",
"?",
":",
"$",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Category.php#L109-L127 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Layer/Filter/Category.php | Category._getItemsData | protected function _getItemsData()
{
$items = [];
/** @var \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $productCollection */
$productCollection = $this->getLayer()->getProductCollection();
$optionsFacetedData = $productCollection->getFacetedData('categories');
... | php | protected function _getItemsData()
{
$items = [];
/** @var \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $productCollection */
$productCollection = $this->getLayer()->getProductCollection();
$optionsFacetedData = $productCollection->getFacetedData('categories');
... | [
"protected",
"function",
"_getItemsData",
"(",
")",
"{",
"$",
"items",
"=",
"[",
"]",
";",
"/** @var \\Magento\\CatalogSearch\\Model\\ResourceModel\\Fulltext\\Collection $productCollection */",
"$",
"productCollection",
"=",
"$",
"this",
"->",
"getLayer",
"(",
")",
"->",
... | @SuppressWarnings(PHPMD.CamelCaseMethodName)
{@inheritDoc} | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"CamelCaseMethodName",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Category.php#L134-L164 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Layer/Filter/Category.php | Category.applyCategoryFilterToCollection | protected function applyCategoryFilterToCollection(\Magento\Catalog\Api\Data\CategoryInterface $category)
{
$this->getLayer()->getProductCollection()->addCategoryFilter($category);
return $this;
} | php | protected function applyCategoryFilterToCollection(\Magento\Catalog\Api\Data\CategoryInterface $category)
{
$this->getLayer()->getProductCollection()->addCategoryFilter($category);
return $this;
} | [
"protected",
"function",
"applyCategoryFilterToCollection",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Api",
"\\",
"Data",
"\\",
"CategoryInterface",
"$",
"category",
")",
"{",
"$",
"this",
"->",
"getLayer",
"(",
")",
"->",
"getProductCollection",
"(",
")",
... | Apply the category filter to the layer product collection.
@param \Magento\Catalog\Api\Data\CategoryInterface $category Category.
@return $this | [
"Apply",
"the",
"category",
"filter",
"to",
"the",
"layer",
"product",
"collection",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Category.php#L173-L178 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Layer/Filter/Category.php | Category._initItems | protected function _initItems()
{
$data = $this->_getItemsData();
$items = [];
foreach ($data as $itemData) {
$item = $this->_createItem($itemData['label'], $itemData['value'], $itemData['count']);
$items[] = $item;
if ($this->useUrlRewrites() === true) {... | php | protected function _initItems()
{
$data = $this->_getItemsData();
$items = [];
foreach ($data as $itemData) {
$item = $this->_createItem($itemData['label'], $itemData['value'], $itemData['count']);
$items[] = $item;
if ($this->useUrlRewrites() === true) {... | [
"protected",
"function",
"_initItems",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"_getItemsData",
"(",
")",
";",
"$",
"items",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"itemData",
")",
"{",
"$",
"item",
"=",
"$",
"thi... | @SuppressWarnings(PHPMD.CamelCaseMethodName)
{@inheritDoc} | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"CamelCaseMethodName",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Category.php#L185-L200 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Layer/Filter/Category.php | Category.getChildrenCategories | protected function getChildrenCategories()
{
if ($this->childrenCategories === null) {
$currentCategory = $this->dataProvider->getCategory();
$this->childrenCategories = $currentCategory->getChildrenCategories();
}
return $this->childrenCategories;
} | php | protected function getChildrenCategories()
{
if ($this->childrenCategories === null) {
$currentCategory = $this->dataProvider->getCategory();
$this->childrenCategories = $currentCategory->getChildrenCategories();
}
return $this->childrenCategories;
} | [
"protected",
"function",
"getChildrenCategories",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"childrenCategories",
"===",
"null",
")",
"{",
"$",
"currentCategory",
"=",
"$",
"this",
"->",
"dataProvider",
"->",
"getCategory",
"(",
")",
";",
"$",
"this",
"... | Retrieve currently selected category children categories.
@return \Magento\Catalog\Model\ResourceModel\Category\Collection|\Magento\Catalog\Model\Category[] | [
"Retrieve",
"currently",
"selected",
"category",
"children",
"categories",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Category.php#L217-L225 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/Report/Event/DateFilterQueryProvider.php | DateFilterQueryProvider.getQuery | public function getQuery()
{
$queryParams = ['field' => 'date', 'bounds' => $this->getDateRange()];
return $this->queryFactory->create(QueryInterface::TYPE_RANGE, $queryParams);
} | php | public function getQuery()
{
$queryParams = ['field' => 'date', 'bounds' => $this->getDateRange()];
return $this->queryFactory->create(QueryInterface::TYPE_RANGE, $queryParams);
} | [
"public",
"function",
"getQuery",
"(",
")",
"{",
"$",
"queryParams",
"=",
"[",
"'field'",
"=>",
"'date'",
",",
"'bounds'",
"=>",
"$",
"this",
"->",
"getDateRange",
"(",
")",
"]",
";",
"return",
"$",
"this",
"->",
"queryFactory",
"->",
"create",
"(",
"Q... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Report/Event/DateFilterQueryProvider.php#L54-L59 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Layer/CategoryPlugin.php | CategoryPlugin.afterGetCurrentCategory | public function afterGetCurrentCategory(
\Magento\Catalog\Model\Layer\Category $layer,
\Magento\Catalog\Api\Data\CategoryInterface $category
) {
$this->searchContext->setCurrentCategory($category);
return $category;
} | php | public function afterGetCurrentCategory(
\Magento\Catalog\Model\Layer\Category $layer,
\Magento\Catalog\Api\Data\CategoryInterface $category
) {
$this->searchContext->setCurrentCategory($category);
return $category;
} | [
"public",
"function",
"afterGetCurrentCategory",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Layer",
"\\",
"Category",
"$",
"layer",
",",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Api",
"\\",
"Data",
"\\",
"CategoryInterface",
"$",
"category",
... | Set the current layer category into the Search context after being assigned to the layer.
@SuppressWarnings(PHPMD.UnusedFormalParameter)
@param \Magento\Catalog\Model\Layer\Category $layer The layer
@param \Magento\Catalog\Api\Data\CategoryInterface $category Current Category
@return \Magento\Catalog\Model\... | [
"Set",
"the",
"current",
"layer",
"category",
"into",
"the",
"Search",
"context",
"after",
"being",
"assigned",
"to",
"the",
"layer",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Layer/CategoryPlugin.php#L53-L60 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Bulk/BulkRequest.php | BulkRequest.addDocument | public function addDocument(IndexInterface $index, TypeInterface $type, $docId, array $data)
{
$this->bulkData[] = ['index' => ['_index' => $index->getName(), '_type' => $type->getName(), '_id' => $docId]];
$this->bulkData[] = $data;
return $this;
} | php | public function addDocument(IndexInterface $index, TypeInterface $type, $docId, array $data)
{
$this->bulkData[] = ['index' => ['_index' => $index->getName(), '_type' => $type->getName(), '_id' => $docId]];
$this->bulkData[] = $data;
return $this;
} | [
"public",
"function",
"addDocument",
"(",
"IndexInterface",
"$",
"index",
",",
"TypeInterface",
"$",
"type",
",",
"$",
"docId",
",",
"array",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"bulkData",
"[",
"]",
"=",
"[",
"'index'",
"=>",
"[",
"'_index'",
"=... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Bulk/BulkRequest.php#L56-L62 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Bulk/BulkRequest.php | BulkRequest.addDocuments | public function addDocuments(IndexInterface $index, TypeInterface $type, array $data)
{
foreach ($data as $docId => $documentData) {
$this->addDocument($index, $type, $docId, $documentData);
}
return $this;
} | php | public function addDocuments(IndexInterface $index, TypeInterface $type, array $data)
{
foreach ($data as $docId => $documentData) {
$this->addDocument($index, $type, $docId, $documentData);
}
return $this;
} | [
"public",
"function",
"addDocuments",
"(",
"IndexInterface",
"$",
"index",
",",
"TypeInterface",
"$",
"type",
",",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"docId",
"=>",
"$",
"documentData",
")",
"{",
"$",
"this",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Bulk/BulkRequest.php#L67-L74 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Bulk/BulkRequest.php | BulkRequest.deleteDocument | public function deleteDocument(IndexInterface $index, TypeInterface $type, $docId)
{
$this->bulkData[] = ['delete' => ['_index' => $index->getName(), '_type' => $type->getName(), '_id' => $docId]];
return $this;
} | php | public function deleteDocument(IndexInterface $index, TypeInterface $type, $docId)
{
$this->bulkData[] = ['delete' => ['_index' => $index->getName(), '_type' => $type->getName(), '_id' => $docId]];
return $this;
} | [
"public",
"function",
"deleteDocument",
"(",
"IndexInterface",
"$",
"index",
",",
"TypeInterface",
"$",
"type",
",",
"$",
"docId",
")",
"{",
"$",
"this",
"->",
"bulkData",
"[",
"]",
"=",
"[",
"'delete'",
"=>",
"[",
"'_index'",
"=>",
"$",
"index",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Bulk/BulkRequest.php#L79-L84 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Bulk/BulkRequest.php | BulkRequest.deleteDocuments | public function deleteDocuments(IndexInterface $index, TypeInterface $type, array $docIds)
{
foreach ($docIds as $docId) {
$this->deleteDocument($index, $type, $docId);
}
return $this;
} | php | public function deleteDocuments(IndexInterface $index, TypeInterface $type, array $docIds)
{
foreach ($docIds as $docId) {
$this->deleteDocument($index, $type, $docId);
}
return $this;
} | [
"public",
"function",
"deleteDocuments",
"(",
"IndexInterface",
"$",
"index",
",",
"TypeInterface",
"$",
"type",
",",
"array",
"$",
"docIds",
")",
"{",
"foreach",
"(",
"$",
"docIds",
"as",
"$",
"docId",
")",
"{",
"$",
"this",
"->",
"deleteDocument",
"(",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Bulk/BulkRequest.php#L89-L96 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Bulk/BulkRequest.php | BulkRequest.updateDocuments | public function updateDocuments(IndexInterface $index, TypeInterface $type, array $data)
{
foreach ($data as $docId => $documentData) {
$this->updateDocument($index, $type, $docId, $documentData);
}
return $this;
} | php | public function updateDocuments(IndexInterface $index, TypeInterface $type, array $data)
{
foreach ($data as $docId => $documentData) {
$this->updateDocument($index, $type, $docId, $documentData);
}
return $this;
} | [
"public",
"function",
"updateDocuments",
"(",
"IndexInterface",
"$",
"index",
",",
"TypeInterface",
"$",
"type",
",",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"docId",
"=>",
"$",
"documentData",
")",
"{",
"$",
"this",
"->",... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Bulk/BulkRequest.php#L112-L119 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Changelog/Writer.php | Writer.addProducts | public function addProducts($productIds)
{
$fullTextIndexer = $this->indexerRegistry->get(\Magento\CatalogSearch\Model\Indexer\Fulltext::INDEXER_ID);
$indexerChangeLog = $fullTextIndexer->getView()->getChangelog();
$changelogTableName = $indexerChangeLog->getName();
$columnName... | php | public function addProducts($productIds)
{
$fullTextIndexer = $this->indexerRegistry->get(\Magento\CatalogSearch\Model\Indexer\Fulltext::INDEXER_ID);
$indexerChangeLog = $fullTextIndexer->getView()->getChangelog();
$changelogTableName = $indexerChangeLog->getName();
$columnName... | [
"public",
"function",
"addProducts",
"(",
"$",
"productIds",
")",
"{",
"$",
"fullTextIndexer",
"=",
"$",
"this",
"->",
"indexerRegistry",
"->",
"get",
"(",
"\\",
"Magento",
"\\",
"CatalogSearch",
"\\",
"Model",
"\\",
"Indexer",
"\\",
"Fulltext",
"::",
"INDEX... | Add products to the fulltext indexer changelog table
@param array $productIds IDs of products to schedule for reindexing
@return void
@throws CouldNotSaveException | [
"Add",
"products",
"to",
"the",
"fulltext",
"indexer",
"changelog",
"table"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Changelog/Writer.php#L59-L81 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/Report/Context.php | Context.getDateRange | public function getDateRange()
{
$fromDate = $this->request->getParam('from', self::DEFAULT_FROM_DATE);
if ($fromDate !== self::DEFAULT_FROM_DATE) {
$fromDate = base64_decode($fromDate);
}
$toDate = $this->request->getParam('to', self::DEFAULT_TO_DATE);
if ($toDat... | php | public function getDateRange()
{
$fromDate = $this->request->getParam('from', self::DEFAULT_FROM_DATE);
if ($fromDate !== self::DEFAULT_FROM_DATE) {
$fromDate = base64_decode($fromDate);
}
$toDate = $this->request->getParam('to', self::DEFAULT_TO_DATE);
if ($toDat... | [
"public",
"function",
"getDateRange",
"(",
")",
"{",
"$",
"fromDate",
"=",
"$",
"this",
"->",
"request",
"->",
"getParam",
"(",
"'from'",
",",
"self",
"::",
"DEFAULT_FROM_DATE",
")",
";",
"if",
"(",
"$",
"fromDate",
"!==",
"self",
"::",
"DEFAULT_FROM_DATE"... | Get date range.
@return array | [
"Get",
"date",
"range",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Report/Context.php#L65-L82 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/Report/Context.php | Context.createDateFromText | private function createDateFromText($text)
{
try {
$date = new \DateTime($text);
} catch (\Exception $e) {
$date = new \DateTime(self::DEFAULT_TO_DATE);
}
return $date->format('Y-m-d');
} | php | private function createDateFromText($text)
{
try {
$date = new \DateTime($text);
} catch (\Exception $e) {
$date = new \DateTime(self::DEFAULT_TO_DATE);
}
return $date->format('Y-m-d');
} | [
"private",
"function",
"createDateFromText",
"(",
"$",
"text",
")",
"{",
"try",
"{",
"$",
"date",
"=",
"new",
"\\",
"DateTime",
"(",
"$",
"text",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"$",
"date",
"=",
"new",
"\\",
"... | Convert a DateTime compatible date or expression into an ES compatible date format
@param string $text Date as text.
@return string | [
"Convert",
"a",
"DateTime",
"compatible",
"date",
"or",
"expression",
"into",
"an",
"ES",
"compatible",
"date",
"format"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Report/Context.php#L91-L100 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php | Switcher.getContainerCode | public function getContainerCode()
{
if (!$this->hasData('container_code')) {
$this->setData('container_code', $this->getRequest()->getParam($this->getContainerVarName()));
}
return $this->getData('container_code');
} | php | public function getContainerCode()
{
if (!$this->hasData('container_code')) {
$this->setData('container_code', $this->getRequest()->getParam($this->getContainerVarName()));
}
return $this->getData('container_code');
} | [
"public",
"function",
"getContainerCode",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasData",
"(",
"'container_code'",
")",
")",
"{",
"$",
"this",
"->",
"setData",
"(",
"'container_code'",
",",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
... | Retrieve container code
@return string|null | [
"Retrieve",
"container",
"code"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php#L136-L143 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php | Switcher.getStoreId | public function getStoreId()
{
if (!$this->hasData('store_id')) {
$this->setData('store_id', (int) $this->getRequest()->getParam($this->getStoreVarName()));
}
return $this->getData('store_id');
} | php | public function getStoreId()
{
if (!$this->hasData('store_id')) {
$this->setData('store_id', (int) $this->getRequest()->getParam($this->getStoreVarName()));
}
return $this->getData('store_id');
} | [
"public",
"function",
"getStoreId",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasData",
"(",
"'store_id'",
")",
")",
"{",
"$",
"this",
"->",
"setData",
"(",
"'store_id'",
",",
"(",
"int",
")",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->... | Retrieve Store Id
@return int|null | [
"Retrieve",
"Store",
"Id"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php#L164-L171 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php | Switcher.isStoreSelected | public function isStoreSelected(\Magento\Store\Model\Store $store)
{
return $this->getStoreId() !== null && (int) $this->getStoreId() === (int) $store->getId();
} | php | public function isStoreSelected(\Magento\Store\Model\Store $store)
{
return $this->getStoreId() !== null && (int) $this->getStoreId() === (int) $store->getId();
} | [
"public",
"function",
"isStoreSelected",
"(",
"\\",
"Magento",
"\\",
"Store",
"\\",
"Model",
"\\",
"Store",
"$",
"store",
")",
"{",
"return",
"$",
"this",
"->",
"getStoreId",
"(",
")",
"!==",
"null",
"&&",
"(",
"int",
")",
"$",
"this",
"->",
"getStoreI... | @param \Magento\Store\Model\Store $store The store
@return bool | [
"@param",
"\\",
"Magento",
"\\",
"Store",
"\\",
"Model",
"\\",
"Store",
"$store",
"The",
"store"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php#L204-L207 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php | Switcher.getSwitchUrl | public function getSwitchUrl()
{
if ($url = $this->getData('switch_url')) {
return $url;
}
return $this->getUrl(
'*/*/*',
[
'_current' => true,
$this->getStoreVarName() => null,
$this... | php | public function getSwitchUrl()
{
if ($url = $this->getData('switch_url')) {
return $url;
}
return $this->getUrl(
'*/*/*',
[
'_current' => true,
$this->getStoreVarName() => null,
$this... | [
"public",
"function",
"getSwitchUrl",
"(",
")",
"{",
"if",
"(",
"$",
"url",
"=",
"$",
"this",
"->",
"getData",
"(",
"'switch_url'",
")",
")",
"{",
"return",
"$",
"url",
";",
"}",
"return",
"$",
"this",
"->",
"getUrl",
"(",
"'*/*/*'",
",",
"[",
"'_c... | Retrieve switch url
@return string | [
"Retrieve",
"switch",
"url"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php#L236-L251 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php | Switcher.getCurrentSelectionName | public function getCurrentSelectionName()
{
$name = $this->getDefaultSelectionName();
if ($this->getCurrentContainerName()) {
$name = $this->getCurrentContainerLabel();
if ($this->getCurrentStoreName()) {
$name .= " > " . $this->getCurrentStoreName();
... | php | public function getCurrentSelectionName()
{
$name = $this->getDefaultSelectionName();
if ($this->getCurrentContainerName()) {
$name = $this->getCurrentContainerLabel();
if ($this->getCurrentStoreName()) {
$name .= " > " . $this->getCurrentStoreName();
... | [
"public",
"function",
"getCurrentSelectionName",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getDefaultSelectionName",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getCurrentContainerName",
"(",
")",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->... | Get current selection name
@return string | [
"Get",
"current",
"selection",
"name"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php#L266-L278 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php | Switcher.getCurrentStoreName | public function getCurrentStoreName()
{
if ($this->getStoreId() !== null) {
$store = $this->storeFactory->create();
$store->load($this->getStoreId());
if ($store->getId()) {
return $store->getName();
}
}
} | php | public function getCurrentStoreName()
{
if ($this->getStoreId() !== null) {
$store = $this->storeFactory->create();
$store->load($this->getStoreId());
if ($store->getId()) {
return $store->getName();
}
}
} | [
"public",
"function",
"getCurrentStoreName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getStoreId",
"(",
")",
"!==",
"null",
")",
"{",
"$",
"store",
"=",
"$",
"this",
"->",
"storeFactory",
"->",
"create",
"(",
")",
";",
"$",
"store",
"->",
"load"... | Get current store view name
@return string | [
"Get",
"current",
"store",
"view",
"name"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php#L285-L294 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php | Switcher.getCurrentContainerName | public function getCurrentContainerName()
{
if ($this->getContainerCode() !== null) {
$container = $this->containersSource->get($this->getContainerCode());
if ($this->getContainerName($container)) {
return $this->getContainerName($container);
}
}
... | php | public function getCurrentContainerName()
{
if ($this->getContainerCode() !== null) {
$container = $this->containersSource->get($this->getContainerCode());
if ($this->getContainerName($container)) {
return $this->getContainerName($container);
}
}
... | [
"public",
"function",
"getCurrentContainerName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getContainerCode",
"(",
")",
"!==",
"null",
")",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"containersSource",
"->",
"get",
"(",
"$",
"this",
"->",
"getCo... | Get current container name
@return string | [
"Get",
"current",
"container",
"name"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php#L301-L310 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php | Switcher.getCurrentContainerLabel | public function getCurrentContainerLabel()
{
if ($this->getContainerCode() !== null) {
$container = $this->containersSource->get($this->getContainerCode());
if ($this->getContainerLabel($container)) {
return $this->getContainerLabel($container);
}
... | php | public function getCurrentContainerLabel()
{
if ($this->getContainerCode() !== null) {
$container = $this->containersSource->get($this->getContainerCode());
if ($this->getContainerLabel($container)) {
return $this->getContainerLabel($container);
}
... | [
"public",
"function",
"getCurrentContainerLabel",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getContainerCode",
"(",
")",
"!==",
"null",
")",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"containersSource",
"->",
"get",
"(",
"$",
"this",
"->",
"getC... | Get current container name
@return string | [
"Get",
"current",
"container",
"name"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php#L329-L338 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php | Switcher.isFullText | public function isFullText($container)
{
$fulltext = false;
if (isset($container['fulltext'])) {
$fulltext = filter_var($container['fulltext'], FILTER_VALIDATE_BOOLEAN);
}
return $fulltext;
} | php | public function isFullText($container)
{
$fulltext = false;
if (isset($container['fulltext'])) {
$fulltext = filter_var($container['fulltext'], FILTER_VALIDATE_BOOLEAN);
}
return $fulltext;
} | [
"public",
"function",
"isFullText",
"(",
"$",
"container",
")",
"{",
"$",
"fulltext",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"container",
"[",
"'fulltext'",
"]",
")",
")",
"{",
"$",
"fulltext",
"=",
"filter_var",
"(",
"$",
"container",
"[",
... | Check if container is used for fulltext queries
@param array $container The container name
@return bool | [
"Check",
"if",
"container",
"is",
"used",
"for",
"fulltext",
"queries"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php#L359-L367 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php | Switcher.hasDefaultOption | public function hasDefaultOption($hasDefaultOption = null)
{
if (null !== $hasDefaultOption) {
$this->hasDefaultOption = $hasDefaultOption;
}
return $this->hasDefaultOption;
} | php | public function hasDefaultOption($hasDefaultOption = null)
{
if (null !== $hasDefaultOption) {
$this->hasDefaultOption = $hasDefaultOption;
}
return $this->hasDefaultOption;
} | [
"public",
"function",
"hasDefaultOption",
"(",
"$",
"hasDefaultOption",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"hasDefaultOption",
")",
"{",
"$",
"this",
"->",
"hasDefaultOption",
"=",
"$",
"hasDefaultOption",
";",
"}",
"return",
"$",
"this",
... | Set/Get whether the switcher should show default option
@param bool $hasDefaultOption If witcher has default option
@return bool | [
"Set",
"/",
"Get",
"whether",
"the",
"switcher",
"should",
"show",
"default",
"option"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php#L376-L383 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php | Switcher._construct | protected function _construct()
{
parent::_construct();
$this->setUseConfirm(true);
$this->setUseAjax(true);
$this->setShowManageStoresLink(0);
if (!$this->hasData('switch_containers')) {
$this->setSwitchContainers(false);
}
if (!$this->hasData(... | php | protected function _construct()
{
parent::_construct();
$this->setUseConfirm(true);
$this->setUseAjax(true);
$this->setShowManageStoresLink(0);
if (!$this->hasData('switch_containers')) {
$this->setSwitchContainers(false);
}
if (!$this->hasData(... | [
"protected",
"function",
"_construct",
"(",
")",
"{",
"parent",
"::",
"_construct",
"(",
")",
";",
"$",
"this",
"->",
"setUseConfirm",
"(",
"true",
")",
";",
"$",
"this",
"->",
"setUseAjax",
"(",
"true",
")",
";",
"$",
"this",
"->",
"setShowManageStoresL... | Internal constructor
@SuppressWarnings(PHPMD.CamelCaseMethodName)
@return void | [
"Internal",
"constructor"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Block/Adminhtml/Search/Request/RelevanceConfig/Scope/Switcher.php#L392-L409 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/ResultsBuilder.php | ResultsBuilder.getPreviewResults | public function getPreviewResults(
ContainerConfigurationInterface $containerConfiguration,
ApplierList $applier,
$size,
$queryText = null,
$category = null
) {
$params = $this->requestBuilder->getSearchRequestParams(
$containerConfiguration,
$... | php | public function getPreviewResults(
ContainerConfigurationInterface $containerConfiguration,
ApplierList $applier,
$size,
$queryText = null,
$category = null
) {
$params = $this->requestBuilder->getSearchRequestParams(
$containerConfiguration,
$... | [
"public",
"function",
"getPreviewResults",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
",",
"ApplierList",
"$",
"applier",
",",
"$",
"size",
",",
"$",
"queryText",
"=",
"null",
",",
"$",
"category",
"=",
"null",
")",
"{",
"$",
"params"... | @param ContainerConfigurationInterface $containerConfiguration Container Configuration
@param ApplierList $applier Optimizers appliers
@param int $size Size
@param string $queryText Query text
@param C... | [
"@param",
"ContainerConfigurationInterface",
"$containerConfiguration",
"Container",
"Configuration",
"@param",
"ApplierList",
"$applier",
"Optimizers",
"appliers",
"@param",
"int",
"$size",
"Size",
"@param",
"string",
"$queryText",
"Query",
"text",
"@param",
"CategoryInterfa... | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/ResultsBuilder.php#L52-L71 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/ResultsBuilder.php | ResultsBuilder.getSearchResults | private function getSearchResults($parameters)
{
$searchRequest = $this->requestBuilder->getSearchRequest($parameters);
$searchResponse = $this->searchEngine->search($searchRequest);
return $searchResponse;
} | php | private function getSearchResults($parameters)
{
$searchRequest = $this->requestBuilder->getSearchRequest($parameters);
$searchResponse = $this->searchEngine->search($searchRequest);
return $searchResponse;
} | [
"private",
"function",
"getSearchResults",
"(",
"$",
"parameters",
")",
"{",
"$",
"searchRequest",
"=",
"$",
"this",
"->",
"requestBuilder",
"->",
"getSearchRequest",
"(",
"$",
"parameters",
")",
";",
"$",
"searchResponse",
"=",
"$",
"this",
"->",
"searchEngin... | Execute search.
@param array $parameters Search Request Parameters
@return \Magento\Framework\Search\ResponseInterface | [
"Execute",
"search",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/ResultsBuilder.php#L80-L86 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Layer/Filter/DecimalFilterTrait.php | DecimalFilterTrait.apply | public function apply(\Magento\Framework\App\RequestInterface $request)
{
/**
* Filter must be string: $fromPrice-$toPrice
*/
$filter = $request->getParam($this->getRequestVar());
if ($filter && !is_array($filter)) {
$filterParams = explode(',', $filter);
... | php | public function apply(\Magento\Framework\App\RequestInterface $request)
{
/**
* Filter must be string: $fromPrice-$toPrice
*/
$filter = $request->getParam($this->getRequestVar());
if ($filter && !is_array($filter)) {
$filterParams = explode(',', $filter);
... | [
"public",
"function",
"apply",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"App",
"\\",
"RequestInterface",
"$",
"request",
")",
"{",
"/**\n * Filter must be string: $fromPrice-$toPrice\n */",
"$",
"filter",
"=",
"$",
"request",
"->",
"getParam",
"(... | Apply price range filter
@param \Magento\Framework\App\RequestInterface $request The request
@return $this
@throws \Magento\Framework\Exception\LocalizedException | [
"Apply",
"price",
"range",
"filter"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/DecimalFilterTrait.php#L34-L68 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Layer/Filter/DecimalFilterTrait.php | DecimalFilterTrait._getItemsData | protected function _getItemsData()
{
$attribute = $this->getAttributeModel();
$this->_requestVar = $attribute->getAttributeCode();
/** @var \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $productCollection */
$productCollection = $this->getLayer()->getProductCollecti... | php | protected function _getItemsData()
{
$attribute = $this->getAttributeModel();
$this->_requestVar = $attribute->getAttributeCode();
/** @var \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $productCollection */
$productCollection = $this->getLayer()->getProductCollecti... | [
"protected",
"function",
"_getItemsData",
"(",
")",
"{",
"$",
"attribute",
"=",
"$",
"this",
"->",
"getAttributeModel",
"(",
")",
";",
"$",
"this",
"->",
"_requestVar",
"=",
"$",
"attribute",
"->",
"getAttributeCode",
"(",
")",
";",
"/** @var \\Magento\\Catalo... | @SuppressWarnings(PHPMD.CamelCaseMethodName)
Get data array for building attribute filter items
@return array
@throws \Magento\Framework\Exception\LocalizedException | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"CamelCaseMethodName",
")",
"Get",
"data",
"array",
"for",
"building",
"attribute",
"filter",
"items"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/DecimalFilterTrait.php#L77-L109 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Search/Request/Product/Attribute/Aggregation/Price.php | Price.getAggregationData | public function getAggregationData(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute)
{
$customerGroupId = $this->customerSession->getCustomerGroupId();
$bucketConfig = [
'name' => 'price.price',
'type' => BucketInterface::TYPE_HISTOGRAM,
... | php | public function getAggregationData(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute)
{
$customerGroupId = $this->customerSession->getCustomerGroupId();
$bucketConfig = [
'name' => 'price.price',
'type' => BucketInterface::TYPE_HISTOGRAM,
... | [
"public",
"function",
"getAggregationData",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"ResourceModel",
"\\",
"Eav",
"\\",
"Attribute",
"$",
"attribute",
")",
"{",
"$",
"customerGroupId",
"=",
"$",
"this",
"->",
"customerSession",
"->",
"getCu... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Attribute/Aggregation/Price.php#L61-L79 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Modifier/Coverage.php | Coverage.modifyAttributes | public function modifyAttributes($storeId, $requestName, $attributes, $query, $filters, $queryFilters)
{
$relevantAttributes = [];
$coverageRates = $this->getCoverageRates($storeId, $requestName, $query, $filters, $queryFilters);
foreach ($attributes as $attribute) {
if ('c... | php | public function modifyAttributes($storeId, $requestName, $attributes, $query, $filters, $queryFilters)
{
$relevantAttributes = [];
$coverageRates = $this->getCoverageRates($storeId, $requestName, $query, $filters, $queryFilters);
foreach ($attributes as $attribute) {
if ('c... | [
"public",
"function",
"modifyAttributes",
"(",
"$",
"storeId",
",",
"$",
"requestName",
",",
"$",
"attributes",
",",
"$",
"query",
",",
"$",
"filters",
",",
"$",
"queryFilters",
")",
"{",
"$",
"relevantAttributes",
"=",
"[",
"]",
";",
"$",
"coverageRates",... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Modifier/Coverage.php#L56-L84 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Modifier/Coverage.php | Coverage.getCoverageRates | private function getCoverageRates($storeId, $requestName, $query = null, $filters = [], $queryFilters = [])
{
$coverageRequest = $this->coverageRequestBuilder->create(
$storeId,
$requestName,
0,
0,
$query,
[],
$filters,
... | php | private function getCoverageRates($storeId, $requestName, $query = null, $filters = [], $queryFilters = [])
{
$coverageRequest = $this->coverageRequestBuilder->create(
$storeId,
$requestName,
0,
0,
$query,
[],
$filters,
... | [
"private",
"function",
"getCoverageRates",
"(",
"$",
"storeId",
",",
"$",
"requestName",
",",
"$",
"query",
"=",
"null",
",",
"$",
"filters",
"=",
"[",
"]",
",",
"$",
"queryFilters",
"=",
"[",
"]",
")",
"{",
"$",
"coverageRequest",
"=",
"$",
"this",
... | Get coverage rate of attributes for current search request.
@param int $storeId The Store ID.
@param string $requestName The Request name.
@param null $query Current Query
@param array $filters Applied filters
@param array $queryFilters Applied Query Filters
@return array | [
"Get",
"coverage",
"rate",
"of",
"attributes",
"for",
"current",
"search",
"request",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Modifier/Coverage.php#L105-L127 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Locator/RegistryLocator.php | RegistryLocator.getOptimizer | public function getOptimizer()
{
if (null !== $this->optimizer) {
return $this->optimizer;
}
if ($optimizer = $this->registry->registry('current_optimizer')) {
return $this->optimizer = $optimizer;
}
return null;
} | php | public function getOptimizer()
{
if (null !== $this->optimizer) {
return $this->optimizer;
}
if ($optimizer = $this->registry->registry('current_optimizer')) {
return $this->optimizer = $optimizer;
}
return null;
} | [
"public",
"function",
"getOptimizer",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"optimizer",
")",
"{",
"return",
"$",
"this",
"->",
"optimizer",
";",
"}",
"if",
"(",
"$",
"optimizer",
"=",
"$",
"this",
"->",
"registry",
"->",
"regis... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Locator/RegistryLocator.php#L49-L60 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Autocomplete/Product/DataProvider.php | DataProvider.getItems | public function getItems()
{
$result = [];
if ($this->configurationHelper->isEnabled($this->getType())) {
foreach ($this->productCollection as $product) {
$result[] = $this->itemFactory->create(['product' => $product, 'type' => $this->getType()]);
}
}... | php | public function getItems()
{
$result = [];
if ($this->configurationHelper->isEnabled($this->getType())) {
foreach ($this->productCollection as $product) {
$result[] = $this->itemFactory->create(['product' => $product, 'type' => $this->getType()]);
}
}... | [
"public",
"function",
"getItems",
"(",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"configurationHelper",
"->",
"isEnabled",
"(",
"$",
"this",
"->",
"getType",
"(",
")",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Product/DataProvider.php#L87-L98 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/ResourceModel/Category/Product/Position.php | Position.getProductPositions | public function getProductPositions($categoryId, $storeId)
{
$select = $this->getBaseSelect()
->where('category_id = ?', (int) $categoryId)
->where('store_id = ?', (int) $storeId)
->where('position IS NOT NULL')
->columns(['product_id', 'position']);
... | php | public function getProductPositions($categoryId, $storeId)
{
$select = $this->getBaseSelect()
->where('category_id = ?', (int) $categoryId)
->where('store_id = ?', (int) $storeId)
->where('position IS NOT NULL')
->columns(['product_id', 'position']);
... | [
"public",
"function",
"getProductPositions",
"(",
"$",
"categoryId",
",",
"$",
"storeId",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"getBaseSelect",
"(",
")",
"->",
"where",
"(",
"'category_id = ?'",
",",
"(",
"int",
")",
"$",
"categoryId",
")",
"... | Get product positions for a given categoryId and Store Id.
@param int $categoryId The Category Id.
@param int $storeId The Store Id.
@return array | [
"Get",
"product",
"positions",
"for",
"a",
"given",
"categoryId",
"and",
"Store",
"Id",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/ResourceModel/Category/Product/Position.php#L41-L50 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/ResourceModel/Category/Product/Position.php | Position.getProductBlacklist | public function getProductBlacklist($categoryId, $storeId)
{
$select = $this->getBaseSelect()
->columns(['product_id'])
->where('category_id = ?', (int) $categoryId)
->where('store_id = ?', (int) $storeId)
->where('is_blacklisted = ?', (int) true);
re... | php | public function getProductBlacklist($categoryId, $storeId)
{
$select = $this->getBaseSelect()
->columns(['product_id'])
->where('category_id = ?', (int) $categoryId)
->where('store_id = ?', (int) $storeId)
->where('is_blacklisted = ?', (int) true);
re... | [
"public",
"function",
"getProductBlacklist",
"(",
"$",
"categoryId",
",",
"$",
"storeId",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"getBaseSelect",
"(",
")",
"->",
"columns",
"(",
"[",
"'product_id'",
"]",
")",
"->",
"where",
"(",
"'category_id = ?... | Get product blacklist for a given categoryId and Store Id.
@param int $categoryId The Category Id.
@param int $storeId The Store Id.
@return array | [
"Get",
"product",
"blacklist",
"for",
"a",
"given",
"categoryId",
"and",
"Store",
"Id",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/ResourceModel/Category/Product/Position.php#L60-L69 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/ResourceModel/Category/Product/Position.php | Position.getProductPositionsByCategory | public function getProductPositionsByCategory($category)
{
$storeId = \Magento\Store\Model\Store::DEFAULT_STORE_ID;
if (is_object($category)) {
if ($category->getUseStorePositions()) {
$storeId = $category->getStoreId();
}
$category = $category->ge... | php | public function getProductPositionsByCategory($category)
{
$storeId = \Magento\Store\Model\Store::DEFAULT_STORE_ID;
if (is_object($category)) {
if ($category->getUseStorePositions()) {
$storeId = $category->getStoreId();
}
$category = $category->ge... | [
"public",
"function",
"getProductPositionsByCategory",
"(",
"$",
"category",
")",
"{",
"$",
"storeId",
"=",
"\\",
"Magento",
"\\",
"Store",
"\\",
"Model",
"\\",
"Store",
"::",
"DEFAULT_STORE_ID",
";",
"if",
"(",
"is_object",
"(",
"$",
"category",
")",
")",
... | Load product positions for the given category.
@param CategoryInterface|int $category Category.
@return array | [
"Load",
"product",
"positions",
"for",
"the",
"given",
"category",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/ResourceModel/Category/Product/Position.php#L78-L89 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/ResourceModel/Category/Product/Position.php | Position.getProductBlacklistByCategory | public function getProductBlacklistByCategory($category)
{
$storeId = \Magento\Store\Model\Store::DEFAULT_STORE_ID;
if (is_object($category)) {
if ($category->getUseStorePositions()) {
$storeId = $category->getStoreId();
}
$category = $category->ge... | php | public function getProductBlacklistByCategory($category)
{
$storeId = \Magento\Store\Model\Store::DEFAULT_STORE_ID;
if (is_object($category)) {
if ($category->getUseStorePositions()) {
$storeId = $category->getStoreId();
}
$category = $category->ge... | [
"public",
"function",
"getProductBlacklistByCategory",
"(",
"$",
"category",
")",
"{",
"$",
"storeId",
"=",
"\\",
"Magento",
"\\",
"Store",
"\\",
"Model",
"\\",
"Store",
"::",
"DEFAULT_STORE_ID",
";",
"if",
"(",
"is_object",
"(",
"$",
"category",
")",
")",
... | Load blacklisted products for the given query.
@param CategoryInterface|int $category Category.
@return array | [
"Load",
"blacklisted",
"products",
"for",
"the",
"given",
"query",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/ResourceModel/Category/Product/Position.php#L98-L109 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/ResourceModel/Category/Product/Position.php | Position.saveProductPositions | public function saveProductPositions(CategoryInterface $category)
{
// Can be 0 if not on a store view.
$storeId = (int) $category->getStoreId();
// If on a store view, and no store override of positions, clean up existing store records.
if ($storeId && !$category->getUseStorePositi... | php | public function saveProductPositions(CategoryInterface $category)
{
// Can be 0 if not on a store view.
$storeId = (int) $category->getStoreId();
// If on a store view, and no store override of positions, clean up existing store records.
if ($storeId && !$category->getUseStorePositi... | [
"public",
"function",
"saveProductPositions",
"(",
"CategoryInterface",
"$",
"category",
")",
"{",
"// Can be 0 if not on a store view.",
"$",
"storeId",
"=",
"(",
"int",
")",
"$",
"category",
"->",
"getStoreId",
"(",
")",
";",
"// If on a store view, and no store overr... | Save the product positions.
@param CategoryInterface $category Saved category.
@return \Smile\ElasticsuiteVirtualCategory\Model\ResourceModel\Category\Product\Position | [
"Save",
"the",
"product",
"positions",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/ResourceModel/Category/Product/Position.php#L118-L158 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/ResourceModel/Category/Product/Position.php | Position.getBaseSelect | private function getBaseSelect()
{
$select = $this->getConnection()->select();
$select->from(['main_table' => $this->getMainTable()], []);
return $select;
} | php | private function getBaseSelect()
{
$select = $this->getConnection()->select();
$select->from(['main_table' => $this->getMainTable()], []);
return $select;
} | [
"private",
"function",
"getBaseSelect",
"(",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"select",
"(",
")",
";",
"$",
"select",
"->",
"from",
"(",
"[",
"'main_table'",
"=>",
"$",
"this",
"->",
"getMainTable",
"(",... | Init a base select with the main table.
@return \Zend_Db_Select | [
"Init",
"a",
"base",
"select",
"with",
"the",
"main",
"table",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/ResourceModel/Category/Product/Position.php#L174-L180 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/Search/Usage/Terms/ConversionRatePostProcessor.php | ConversionRatePostProcessor.postProcessResponse | public function postProcessResponse($data)
{
$terms = array_keys($data);
$storeId = $this->context->getStoreId();
$from = 0;
$size = 0;
$searchQuery = $this->queryFactory->create(
QueryInterface::TYPE_TERMS,
['field' => '... | php | public function postProcessResponse($data)
{
$terms = array_keys($data);
$storeId = $this->context->getStoreId();
$from = 0;
$size = 0;
$searchQuery = $this->queryFactory->create(
QueryInterface::TYPE_TERMS,
['field' => '... | [
"public",
"function",
"postProcessResponse",
"(",
"$",
"data",
")",
"{",
"$",
"terms",
"=",
"array_keys",
"(",
"$",
"data",
")",
";",
"$",
"storeId",
"=",
"$",
"this",
"->",
"context",
"->",
"getStoreId",
"(",
")",
";",
"$",
"from",
"=",
"0",
";",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Search/Usage/Terms/ConversionRatePostProcessor.php#L97-L162 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/Search/Usage/Terms/ConversionRatePostProcessor.php | ConversionRatePostProcessor.getQueryFilters | private function getQueryFilters()
{
$queries = [];
foreach ($this->queryProviders as $queryProvider) {
$queries[] = $queryProvider->getQuery();
}
return array_filter($queries);
} | php | private function getQueryFilters()
{
$queries = [];
foreach ($this->queryProviders as $queryProvider) {
$queries[] = $queryProvider->getQuery();
}
return array_filter($queries);
} | [
"private",
"function",
"getQueryFilters",
"(",
")",
"{",
"$",
"queries",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"queryProviders",
"as",
"$",
"queryProvider",
")",
"{",
"$",
"queries",
"[",
"]",
"=",
"$",
"queryProvider",
"->",
"getQuery",... | Get query filters.
@return array | [
"Get",
"query",
"filters",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Search/Usage/Terms/ConversionRatePostProcessor.php#L169-L178 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Rss/CategoryPlugin.php | CategoryPlugin.afterGetProductCollection | public function afterGetProductCollection(
\Magento\Catalog\Model\Rss\Category $dataProvider,
\Magento\Catalog\Model\ResourceModel\Product\Collection $collection,
\Magento\Catalog\Model\Category $category,
$storeId
) {
$collection->addFieldToFilter('category_ids', $this->getC... | php | public function afterGetProductCollection(
\Magento\Catalog\Model\Rss\Category $dataProvider,
\Magento\Catalog\Model\ResourceModel\Product\Collection $collection,
\Magento\Catalog\Model\Category $category,
$storeId
) {
$collection->addFieldToFilter('category_ids', $this->getC... | [
"public",
"function",
"afterGetProductCollection",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Rss",
"\\",
"Category",
"$",
"dataProvider",
",",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"ResourceModel",
"\\",
"Product",
"\\",
"Co... | Apply category filter to the collection
@SuppressWarnings(PHPMD.UnusedFormalParameter)
@param \Magento\Catalog\Model\Rss\Category $dataProvider Data provider.
@param \Magento\Catalog\Model\ResourceModel\Product\Collection $collection Product collection.
@param \Magento\Catalog\Model\Category ... | [
"Apply",
"category",
"filter",
"to",
"the",
"collection"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Rss/CategoryPlugin.php#L38-L47 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Rss/CategoryPlugin.php | CategoryPlugin.getCategoryFilterParam | private function getCategoryFilterParam(\Magento\Catalog\Model\Category $category)
{
$filterParam = $category->getId();
if ($category->getVirtualRule()) { // Implicit dependency to Virtual Categories module.
$category->setIsActive(true);
$filterParam = $category->getVirtual... | php | private function getCategoryFilterParam(\Magento\Catalog\Model\Category $category)
{
$filterParam = $category->getId();
if ($category->getVirtualRule()) { // Implicit dependency to Virtual Categories module.
$category->setIsActive(true);
$filterParam = $category->getVirtual... | [
"private",
"function",
"getCategoryFilterParam",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Category",
"$",
"category",
")",
"{",
"$",
"filterParam",
"=",
"$",
"category",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"$",
"category",
"->",
... | Return category filter param
@param \Magento\Catalog\Model\Category $category Category.
@return int|QueryInterface | [
"Return",
"category",
"filter",
"param"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Rss/CategoryPlugin.php#L56-L67 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php | FrontPlugin.aroundSetForm | public function aroundSetForm(Front $subject, \Closure $proceed, Form $form)
{
$block = $proceed($form);
$fieldset = $this->createFieldset($form, $subject);
$this->moveOrginalFields($form);
$this->addSearchFields($fieldset);
$this->addAutocompleteFields($fieldset);
... | php | public function aroundSetForm(Front $subject, \Closure $proceed, Form $form)
{
$block = $proceed($form);
$fieldset = $this->createFieldset($form, $subject);
$this->moveOrginalFields($form);
$this->addSearchFields($fieldset);
$this->addAutocompleteFields($fieldset);
... | [
"public",
"function",
"aroundSetForm",
"(",
"Front",
"$",
"subject",
",",
"\\",
"Closure",
"$",
"proceed",
",",
"Form",
"$",
"form",
")",
"{",
"$",
"block",
"=",
"$",
"proceed",
"(",
"$",
"form",
")",
";",
"$",
"fieldset",
"=",
"$",
"this",
"->",
"... | Append ES specifics fields into the attribute edit store front tab.
@param Front $subject The StoreFront tab
@param \Closure $proceed The parent function
@param Form $form The form
@return Front | [
"Append",
"ES",
"specifics",
"fields",
"into",
"the",
"attribute",
"edit",
"store",
"front",
"tab",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php#L93-L113 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php | FrontPlugin.moveOrginalFields | private function moveOrginalFields(Form $form)
{
$originalFieldset = $form->getElement('front_fieldset');
$targetFieldset = $form->getElement('elasticsuite_catalog_attribute_fieldset');
foreach ($this->movedFields as $elementId) {
$element = $form->getElement($elementId);
... | php | private function moveOrginalFields(Form $form)
{
$originalFieldset = $form->getElement('front_fieldset');
$targetFieldset = $form->getElement('elasticsuite_catalog_attribute_fieldset');
foreach ($this->movedFields as $elementId) {
$element = $form->getElement($elementId);
... | [
"private",
"function",
"moveOrginalFields",
"(",
"Form",
"$",
"form",
")",
"{",
"$",
"originalFieldset",
"=",
"$",
"form",
"->",
"getElement",
"(",
"'front_fieldset'",
")",
";",
"$",
"targetFieldset",
"=",
"$",
"form",
"->",
"getElement",
"(",
"'elasticsuite_c... | Move original fields to the new fieldset.
@param Form $form Form
@return FrontPlugin | [
"Move",
"original",
"fields",
"to",
"the",
"new",
"fieldset",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php#L154-L177 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php | FrontPlugin.addAutocompleteFields | private function addAutocompleteFields(Fieldset $fieldset)
{
$fieldset->addField(
'is_displayed_in_autocomplete',
'select',
[
'name' => 'is_displayed_in_autocomplete',
'label' => __('Display in autocomplete'),
'values' =>... | php | private function addAutocompleteFields(Fieldset $fieldset)
{
$fieldset->addField(
'is_displayed_in_autocomplete',
'select',
[
'name' => 'is_displayed_in_autocomplete',
'label' => __('Display in autocomplete'),
'values' =>... | [
"private",
"function",
"addAutocompleteFields",
"(",
"Fieldset",
"$",
"fieldset",
")",
"{",
"$",
"fieldset",
"->",
"addField",
"(",
"'is_displayed_in_autocomplete'",
",",
"'select'",
",",
"[",
"'name'",
"=>",
"'is_displayed_in_autocomplete'",
",",
"'label'",
"=>",
"... | Append autocomplete related fields.
@param Fieldset $fieldset Target fieldset
@return FrontPlugin | [
"Append",
"autocomplete",
"related",
"fields",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php#L186-L200 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.