repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/Query/Builder.php | Builder.createFulltextQuery | public function createFulltextQuery(ContainerConfigurationInterface $containerConfiguration, $queryText, $spellingType)
{
return $this->fulltextQueryBuilder->create($containerConfiguration, $queryText, $spellingType);
} | php | public function createFulltextQuery(ContainerConfigurationInterface $containerConfiguration, $queryText, $spellingType)
{
return $this->fulltextQueryBuilder->create($containerConfiguration, $queryText, $spellingType);
} | [
"public",
"function",
"createFulltextQuery",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
",",
"$",
"queryText",
",",
"$",
"spellingType",
")",
"{",
"return",
"$",
"this",
"->",
"fulltextQueryBuilder",
"->",
"create",
"(",
"$",
"containerConf... | Create a query from a search text query.
@param ContainerConfigurationInterface $containerConfiguration Search request container configuration.
@param string|null $queryText Fulltext query.
@param string $spellingType For fulltext query : the type of ... | [
"Create",
"a",
"query",
"from",
"a",
"search",
"text",
"query",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Query/Builder.php#L117-L120 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Controller/Adminhtml/Search/Request/RelevanceConfig/AbstractConfig.php | AbstractConfig.dispatch | public function dispatch(RequestInterface $request)
{
if (!$request->getParam('section')) {
$request->setParam('section', $this->configStructure->getFirstSection()->getId());
}
return parent::dispatch($request);
} | php | public function dispatch(RequestInterface $request)
{
if (!$request->getParam('section')) {
$request->setParam('section', $this->configStructure->getFirstSection()->getId());
}
return parent::dispatch($request);
} | [
"public",
"function",
"dispatch",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"getParam",
"(",
"'section'",
")",
")",
"{",
"$",
"request",
"->",
"setParam",
"(",
"'section'",
",",
"$",
"this",
"->",
"configStr... | Check if current section is found and is allowed
@param RequestInterface $request The current request
@return \Magento\Framework\App\ResponseInterface | [
"Check",
"if",
"current",
"section",
"is",
"found",
"and",
"is",
"allowed"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Controller/Adminhtml/Search/Request/RelevanceConfig/AbstractConfig.php#L66-L73 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Controller/Adminhtml/Search/Request/RelevanceConfig/AbstractConfig.php | AbstractConfig._isAllowed | protected function _isAllowed()
{
$sectionId = $this->_request->getParam('section');
return $this->configStructure->getElement($sectionId)->isAllowed()
|| $this->_authorization->isAllowed('Smile_ElasticsuiteCore::manage_relevance');
} | php | protected function _isAllowed()
{
$sectionId = $this->_request->getParam('section');
return $this->configStructure->getElement($sectionId)->isAllowed()
|| $this->_authorization->isAllowed('Smile_ElasticsuiteCore::manage_relevance');
} | [
"protected",
"function",
"_isAllowed",
"(",
")",
"{",
"$",
"sectionId",
"=",
"$",
"this",
"->",
"_request",
"->",
"getParam",
"(",
"'section'",
")",
";",
"return",
"$",
"this",
"->",
"configStructure",
"->",
"getElement",
"(",
"$",
"sectionId",
")",
"->",
... | Check is allow modify system configuration
@SuppressWarnings(PHPMD.CamelCaseMethodName)
@return bool | [
"Check",
"is",
"allow",
"modify",
"system",
"configuration"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Controller/Adminhtml/Search/Request/RelevanceConfig/AbstractConfig.php#L82-L88 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Autocomplete/Product/AttributeConfig.php | AttributeConfig.prepareAutocompleteAttributeCollection | private function prepareAutocompleteAttributeCollection()
{
$storeId = $this->storeManager->getStore()->getId();
$this->autocompleteAttributeCollection->addStoreLabel($storeId)
->addFieldToFilter('is_displayed_in_autocomplete', true)
->load();
return $this;
} | php | private function prepareAutocompleteAttributeCollection()
{
$storeId = $this->storeManager->getStore()->getId();
$this->autocompleteAttributeCollection->addStoreLabel($storeId)
->addFieldToFilter('is_displayed_in_autocomplete', true)
->load();
return $this;
} | [
"private",
"function",
"prepareAutocompleteAttributeCollection",
"(",
")",
"{",
"$",
"storeId",
"=",
"$",
"this",
"->",
"storeManager",
"->",
"getStore",
"(",
")",
"->",
"getId",
"(",
")",
";",
"$",
"this",
"->",
"autocompleteAttributeCollection",
"->",
"addStor... | Init the list of attribute displayed in autocomplete.
@return $this | [
"Init",
"the",
"list",
"of",
"attribute",
"displayed",
"in",
"autocomplete",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Product/AttributeConfig.php#L138-L147 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Observer/TrackRedirectIfOneResult.php | TrackRedirectIfOneResult.execute | public function execute(\Magento\Framework\Event\Observer $observer)
{
$productCollection = $observer->getEvent()->getData('product_collection');
$storeId = $observer->getEvent()->getData('store_id');
if (($productCollection instanceof \Magento\Catalog\Model\ResourceModel\Product\... | php | public function execute(\Magento\Framework\Event\Observer $observer)
{
$productCollection = $observer->getEvent()->getData('product_collection');
$storeId = $observer->getEvent()->getData('store_id');
if (($productCollection instanceof \Magento\Catalog\Model\ResourceModel\Product\... | [
"public",
"function",
"execute",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Event",
"\\",
"Observer",
"$",
"observer",
")",
"{",
"$",
"productCollection",
"=",
"$",
"observer",
"->",
"getEvent",
"(",
")",
"->",
"getData",
"(",
"'product_collection'",
")... | Logs a fulltext search event before the user is redirected to the product page.
@SuppressWarnings(PHPMD.UnusedFormalParameter)
@event elasticsuite_redirect_if_one_result
@param \Magento\Framework\Event\Observer $observer The observer
@return void | [
"Logs",
"a",
"fulltext",
"search",
"event",
"before",
"the",
"user",
"is",
"redirected",
"to",
"the",
"product",
"page",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Observer/TrackRedirectIfOneResult.php#L90-L98 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Observer/TrackRedirectIfOneResult.php | TrackRedirectIfOneResult.logEvent | private function logEvent($productCollection, int $storeId): void
{
$sessionData = $this->getSessionData();
if (!empty($sessionData)) {
$pageData = [
'store_id' => $storeId,
'search' => [
'query' => $this->helper->getEs... | php | private function logEvent($productCollection, int $storeId): void
{
$sessionData = $this->getSessionData();
if (!empty($sessionData)) {
$pageData = [
'store_id' => $storeId,
'search' => [
'query' => $this->helper->getEs... | [
"private",
"function",
"logEvent",
"(",
"$",
"productCollection",
",",
"int",
"$",
"storeId",
")",
":",
"void",
"{",
"$",
"sessionData",
"=",
"$",
"this",
"->",
"getSessionData",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"sessionData",
")",
")"... | Log the event.
@param \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection Product collection.
@param int $storeId Store Id.
@return void | [
"Log",
"the",
"event",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Observer/TrackRedirectIfOneResult.php#L108-L131 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Observer/TrackRedirectIfOneResult.php | TrackRedirectIfOneResult.getPageTypeLabel | private function getPageTypeLabel($pageTypeIdentifier)
{
$label = '';
$labelByIdentifier = $this->getPageTypeLabelMap();
if (isset($labelByIdentifier[$pageTypeIdentifier])) {
$label = $labelByIdentifier[$pageTypeIdentifier];
}
return $label;
} | php | private function getPageTypeLabel($pageTypeIdentifier)
{
$label = '';
$labelByIdentifier = $this->getPageTypeLabelMap();
if (isset($labelByIdentifier[$pageTypeIdentifier])) {
$label = $labelByIdentifier[$pageTypeIdentifier];
}
return $label;
} | [
"private",
"function",
"getPageTypeLabel",
"(",
"$",
"pageTypeIdentifier",
")",
"{",
"$",
"label",
"=",
"''",
";",
"$",
"labelByIdentifier",
"=",
"$",
"this",
"->",
"getPageTypeLabelMap",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"labelByIdentifier",
"[",... | Human readable version of the page type identifier.
@param string $pageTypeIdentifier Page type identifier.
@return string | [
"Human",
"readable",
"version",
"of",
"the",
"page",
"type",
"identifier",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Observer/TrackRedirectIfOneResult.php#L153-L163 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Aggregation/Builder/DateHistogram.php | DateHistogram.buildBucket | public function buildBucket(BucketInterface $bucket)
{
if ($bucket->getType() !== BucketInterface::TYPE_DATE_HISTOGRAM) {
throw new \InvalidArgumentException("Query builder : invalid aggregation type {$bucket->getType()}.");
}
$aggParams = [
'field' => $bucke... | php | public function buildBucket(BucketInterface $bucket)
{
if ($bucket->getType() !== BucketInterface::TYPE_DATE_HISTOGRAM) {
throw new \InvalidArgumentException("Query builder : invalid aggregation type {$bucket->getType()}.");
}
$aggParams = [
'field' => $bucke... | [
"public",
"function",
"buildBucket",
"(",
"BucketInterface",
"$",
"bucket",
")",
"{",
"if",
"(",
"$",
"bucket",
"->",
"getType",
"(",
")",
"!==",
"BucketInterface",
"::",
"TYPE_DATE_HISTOGRAM",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"... | Build the aggregation.
@param BucketInterface $bucket Histogram bucket.
@return array | [
"Build",
"the",
"aggregation",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Aggregation/Builder/DateHistogram.php#L36-L49 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-rule/Controller/Adminhtml/Product/Rule/Conditions.php | Conditions.execute | public function execute()
{
$conditionId = $this->getRequest()->getParam('id');
$typeData = explode('|', str_replace('-', '/', $this->getRequest()->getParam('type')));
$className = $typeData[0];
$rule = $this->ruleFactory->create();
$model = $this->_objectManager->create($c... | php | public function execute()
{
$conditionId = $this->getRequest()->getParam('id');
$typeData = explode('|', str_replace('-', '/', $this->getRequest()->getParam('type')));
$className = $typeData[0];
$rule = $this->ruleFactory->create();
$model = $this->_objectManager->create($c... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"conditionId",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",
"'id'",
")",
";",
"$",
"typeData",
"=",
"explode",
"(",
"'|'",
",",
"str_replace",
"(",
"'-'",
",",
"'/'",
",",... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-rule/Controller/Adminhtml/Product/Rule/Conditions.php#L59-L86 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php | Thesaurus.getStoreIdsFromThesaurusId | public function getStoreIdsFromThesaurusId($thesaurusId)
{
$connection = $this->getConnection();
$select = $connection->select();
$select->from($this->getTable(ThesaurusInterface::STORE_TABLE_NAME), ThesaurusInterface::STORE_ID)
->where(ThesaurusInterface::THESAURUS_ID . ' = ?'... | php | public function getStoreIdsFromThesaurusId($thesaurusId)
{
$connection = $this->getConnection();
$select = $connection->select();
$select->from($this->getTable(ThesaurusInterface::STORE_TABLE_NAME), ThesaurusInterface::STORE_ID)
->where(ThesaurusInterface::THESAURUS_ID . ' = ?'... | [
"public",
"function",
"getStoreIdsFromThesaurusId",
"(",
"$",
"thesaurusId",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"$",
"select",
"=",
"$",
"connection",
"->",
"select",
"(",
")",
";",
"$",
"select",
"->",
"... | Retrieve Store Ids for a given thesaurus
@param int $thesaurusId The thesaurus Id
@return array | [
"Retrieve",
"Store",
"Ids",
"for",
"a",
"given",
"thesaurus"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php#L34-L44 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php | Thesaurus.getTermsDataFromThesaurus | public function getTermsDataFromThesaurus($object)
{
$connection = $this->getConnection();
$binds = [':thesaurus_id' => (int) $object->getThesaurusId()];
$select = $connection->select();
$select->from(['expansion_table' => $this->getTable(ThesaurusInterface::EXPANSION_TABLE_NA... | php | public function getTermsDataFromThesaurus($object)
{
$connection = $this->getConnection();
$binds = [':thesaurus_id' => (int) $object->getThesaurusId()];
$select = $connection->select();
$select->from(['expansion_table' => $this->getTable(ThesaurusInterface::EXPANSION_TABLE_NA... | [
"public",
"function",
"getTermsDataFromThesaurus",
"(",
"$",
"object",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"$",
"binds",
"=",
"[",
"':thesaurus_id'",
"=>",
"(",
"int",
")",
"$",
"object",
"->",
"getThesaurus... | Retrieve Store Ids for a given thesaurus
@param \Magento\Framework\Model\AbstractModel $object The thesaurus
@return array | [
"Retrieve",
"Store",
"Ids",
"for",
"a",
"given",
"thesaurus"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php#L53-L83 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php | Thesaurus._afterSave | protected function _afterSave(\Magento\Framework\Model\AbstractModel $object)
{
parent::_afterSave($object);
$this->saveStoreRelation($object);
$this->saveTermsRelation($object);
return $this;
} | php | protected function _afterSave(\Magento\Framework\Model\AbstractModel $object)
{
parent::_afterSave($object);
$this->saveStoreRelation($object);
$this->saveTermsRelation($object);
return $this;
} | [
"protected",
"function",
"_afterSave",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Model",
"\\",
"AbstractModel",
"$",
"object",
")",
"{",
"parent",
"::",
"_afterSave",
"(",
"$",
"object",
")",
";",
"$",
"this",
"->",
"saveStoreRelation",
"(",
"$",
"ob... | Saves thesaurus linking to terms and stores after save
@SuppressWarnings(PHPMD.CamelCaseMethodName)
@param \Magento\Framework\Model\AbstractModel $object Thesaurus to save
@return $this | [
"Saves",
"thesaurus",
"linking",
"to",
"terms",
"and",
"stores",
"after",
"save"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php#L104-L112 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php | Thesaurus._afterLoad | protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
if ($object->getId()) {
$stores = $this->getStoreIdsFromThesaurusId($object->getId());
$object->setStoreIds($stores);
}
return parent::_afterLoad($object);
} | php | protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
if ($object->getId()) {
$stores = $this->getStoreIdsFromThesaurusId($object->getId());
$object->setStoreIds($stores);
}
return parent::_afterLoad($object);
} | [
"protected",
"function",
"_afterLoad",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Model",
"\\",
"AbstractModel",
"$",
"object",
")",
"{",
"if",
"(",
"$",
"object",
"->",
"getId",
"(",
")",
")",
"{",
"$",
"stores",
"=",
"$",
"this",
"->",
"getStore... | Perform operations after object load, restore linking with terms and stores
@SuppressWarnings(PHPMD.CamelCaseMethodName)
@param \Magento\Framework\Model\AbstractModel $object Thesaurus being loaded
@return $this | [
"Perform",
"operations",
"after",
"object",
"load",
"restore",
"linking",
"with",
"terms",
"and",
"stores"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php#L123-L131 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php | Thesaurus.saveStoreRelation | private function saveStoreRelation(\Magento\Framework\Model\AbstractModel $object)
{
$storeIds = $object->getStoreIds();
if (is_array($storeIds) && (count($storeIds) > 0)) {
if (in_array(0, $storeIds)) {
$storeIds = [0];
}
$storeLinks = [];
... | php | private function saveStoreRelation(\Magento\Framework\Model\AbstractModel $object)
{
$storeIds = $object->getStoreIds();
if (is_array($storeIds) && (count($storeIds) > 0)) {
if (in_array(0, $storeIds)) {
$storeIds = [0];
}
$storeLinks = [];
... | [
"private",
"function",
"saveStoreRelation",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Model",
"\\",
"AbstractModel",
"$",
"object",
")",
"{",
"$",
"storeIds",
"=",
"$",
"object",
"->",
"getStoreIds",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
... | Saves relation between thesaurus and store
@param \Magento\Framework\Model\AbstractModel $object Thesaurus to save
@return void | [
"Saves",
"relation",
"between",
"thesaurus",
"and",
"store"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php#L140-L168 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php | Thesaurus.saveTermsRelation | private function saveTermsRelation(\Magento\Framework\Model\AbstractModel $object)
{
$termRelations = $object->getTermsRelations();
$termRelations = array_filter($termRelations);
if (is_array($termRelations) && (count($termRelations) > 0)) {
$expansionTermLinks = [];
... | php | private function saveTermsRelation(\Magento\Framework\Model\AbstractModel $object)
{
$termRelations = $object->getTermsRelations();
$termRelations = array_filter($termRelations);
if (is_array($termRelations) && (count($termRelations) > 0)) {
$expansionTermLinks = [];
... | [
"private",
"function",
"saveTermsRelation",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Model",
"\\",
"AbstractModel",
"$",
"object",
")",
"{",
"$",
"termRelations",
"=",
"$",
"object",
"->",
"getTermsRelations",
"(",
")",
";",
"$",
"termRelations",
"=",
... | Saves relation between thesaurus and store
@param \Magento\Framework\Model\AbstractModel $object Thesaurus to save
@return void | [
"Saves",
"relation",
"between",
"thesaurus",
"and",
"store"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php#L177-L219 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php | Thesaurus.deleteThesaurusRelations | private function deleteThesaurusRelations(\Magento\Framework\Model\AbstractModel $object)
{
$deleteCondition = [ThesaurusInterface::THESAURUS_ID . " = ?" => $object->getThesaurusId()];
$this->getConnection()->delete(
$this->getTable(ThesaurusInterface::EXPANSION_TABLE_NAME),
... | php | private function deleteThesaurusRelations(\Magento\Framework\Model\AbstractModel $object)
{
$deleteCondition = [ThesaurusInterface::THESAURUS_ID . " = ?" => $object->getThesaurusId()];
$this->getConnection()->delete(
$this->getTable(ThesaurusInterface::EXPANSION_TABLE_NAME),
... | [
"private",
"function",
"deleteThesaurusRelations",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Model",
"\\",
"AbstractModel",
"$",
"object",
")",
"{",
"$",
"deleteCondition",
"=",
"[",
"ThesaurusInterface",
"::",
"THESAURUS_ID",
".",
"\" = ?\"",
"=>",
"$",
"... | Delete thesaurus previous relations.
@param \Magento\Framework\Model\AbstractModel $object Thesaurus to save
@return $this | [
"Delete",
"thesaurus",
"previous",
"relations",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php#L228-L238 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php | Thesaurus.saveReferenceTerms | private function saveReferenceTerms(\Magento\Framework\Model\AbstractModel $object, $referenceTerms)
{
if ($object->getType() === ThesaurusInterface::TYPE_EXPANSION) {
$this->getConnection()->insertOnDuplicate(
$this->getTable(ThesaurusInterface::REFERENCE_TABLE_NAME),
... | php | private function saveReferenceTerms(\Magento\Framework\Model\AbstractModel $object, $referenceTerms)
{
if ($object->getType() === ThesaurusInterface::TYPE_EXPANSION) {
$this->getConnection()->insertOnDuplicate(
$this->getTable(ThesaurusInterface::REFERENCE_TABLE_NAME),
... | [
"private",
"function",
"saveReferenceTerms",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Model",
"\\",
"AbstractModel",
"$",
"object",
",",
"$",
"referenceTerms",
")",
"{",
"if",
"(",
"$",
"object",
"->",
"getType",
"(",
")",
"===",
"ThesaurusInterface",
... | Saves reference terms for a thesaurus. Reference term are used by expansions thesaurus only.
@param \Magento\Framework\Model\AbstractModel $object Thesaurus to save
@param array $referenceTerms Thesaurus reference terms
@return $this | [
"Saves",
"reference",
"terms",
"for",
"a",
"thesaurus",
".",
"Reference",
"term",
"are",
"used",
"by",
"expansions",
"thesaurus",
"only",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php#L248-L259 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ProductSorter/AbstractPreview.php | AbstractPreview.getData | public function getData()
{
$data = $this->getUnsortedProductData();
$sortedProducts = $this->getSortedProducts();
$data['products'] = $this->preparePreviewItems(array_merge($sortedProducts, $data['products']));
return $data;
} | php | public function getData()
{
$data = $this->getUnsortedProductData();
$sortedProducts = $this->getSortedProducts();
$data['products'] = $this->preparePreviewItems(array_merge($sortedProducts, $data['products']));
return $data;
} | [
"public",
"function",
"getData",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"getUnsortedProductData",
"(",
")",
";",
"$",
"sortedProducts",
"=",
"$",
"this",
"->",
"getSortedProducts",
"(",
")",
";",
"$",
"data",
"[",
"'products'",
"]",
"=",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ProductSorter/AbstractPreview.php#L88-L96 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ProductSorter/AbstractPreview.php | AbstractPreview.prepareProductCollection | protected function prepareProductCollection(\Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection $collection)
{
return $collection;
} | php | protected function prepareProductCollection(\Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection $collection)
{
return $collection;
} | [
"protected",
"function",
"prepareProductCollection",
"(",
"\\",
"Smile",
"\\",
"ElasticsuiteCatalog",
"\\",
"Model",
"\\",
"ResourceModel",
"\\",
"Product",
"\\",
"Fulltext",
"\\",
"Collection",
"$",
"collection",
")",
"{",
"return",
"$",
"collection",
";",
"}"
] | Apply custom logic to product collection.
@param \Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection $collection Product collection.
@return \Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection | [
"Apply",
"custom",
"logic",
"to",
"product",
"collection",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ProductSorter/AbstractPreview.php#L105-L108 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ProductSorter/AbstractPreview.php | AbstractPreview.preparePreviewItems | private function preparePreviewItems($products = [])
{
$items = [];
foreach ($products as $product) {
$items[$product->getId()] = $this->itemFactory->getData($product);
}
return array_values($items);
} | php | private function preparePreviewItems($products = [])
{
$items = [];
foreach ($products as $product) {
$items[$product->getId()] = $this->itemFactory->getData($product);
}
return array_values($items);
} | [
"private",
"function",
"preparePreviewItems",
"(",
"$",
"products",
"=",
"[",
"]",
")",
"{",
"$",
"items",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"products",
"as",
"$",
"product",
")",
"{",
"$",
"items",
"[",
"$",
"product",
"->",
"getId",
"(",
"... | Convert an array of products to an array of preview items.
@param \Magento\Catalog\Model\ResourceModel\Product[] $products Product list.
@return array | [
"Convert",
"an",
"array",
"of",
"products",
"to",
"an",
"array",
"of",
"preview",
"items",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ProductSorter/AbstractPreview.php#L124-L133 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ProductSorter/AbstractPreview.php | AbstractPreview.getProductCollection | private function getProductCollection()
{
$productCollection = $this->collectionFactory->create();
$productCollection->setStoreId($this->storeId)
->addAttributeToSelect(['name', 'small_image']);
return $this->prepareProductCollection($productCollection);
} | php | private function getProductCollection()
{
$productCollection = $this->collectionFactory->create();
$productCollection->setStoreId($this->storeId)
->addAttributeToSelect(['name', 'small_image']);
return $this->prepareProductCollection($productCollection);
} | [
"private",
"function",
"getProductCollection",
"(",
")",
"{",
"$",
"productCollection",
"=",
"$",
"this",
"->",
"collectionFactory",
"->",
"create",
"(",
")",
";",
"$",
"productCollection",
"->",
"setStoreId",
"(",
"$",
"this",
"->",
"storeId",
")",
"->",
"a... | Preview base product collection.
@return \Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection | [
"Preview",
"base",
"product",
"collection",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ProductSorter/AbstractPreview.php#L140-L148 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ProductSorter/AbstractPreview.php | AbstractPreview.getUnsortedProductData | private function getUnsortedProductData()
{
$productCollection = $this->getProductCollection()->setPageSize($this->size);
if (!in_array($this->search, [null, ''])) {
$productCollection->setSearchQuery($this->search);
}
return ['products' => $productCollection->getItems(... | php | private function getUnsortedProductData()
{
$productCollection = $this->getProductCollection()->setPageSize($this->size);
if (!in_array($this->search, [null, ''])) {
$productCollection->setSearchQuery($this->search);
}
return ['products' => $productCollection->getItems(... | [
"private",
"function",
"getUnsortedProductData",
"(",
")",
"{",
"$",
"productCollection",
"=",
"$",
"this",
"->",
"getProductCollection",
"(",
")",
"->",
"setPageSize",
"(",
"$",
"this",
"->",
"size",
")",
";",
"if",
"(",
"!",
"in_array",
"(",
"$",
"this",... | Return a collection with with products that match the current preview.
@return array | [
"Return",
"a",
"collection",
"with",
"with",
"products",
"that",
"match",
"the",
"current",
"preview",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ProductSorter/AbstractPreview.php#L155-L164 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ProductSorter/AbstractPreview.php | AbstractPreview.getSortedProducts | private function getSortedProducts()
{
$products = [];
$productIds = $this->getSortedProductIds();
if ($productIds && count($productIds)) {
$productCollection = $this->getProductCollection()->setPageSize(count($productIds));
$idFilterParams = ['values' => $product... | php | private function getSortedProducts()
{
$products = [];
$productIds = $this->getSortedProductIds();
if ($productIds && count($productIds)) {
$productCollection = $this->getProductCollection()->setPageSize(count($productIds));
$idFilterParams = ['values' => $product... | [
"private",
"function",
"getSortedProducts",
"(",
")",
"{",
"$",
"products",
"=",
"[",
"]",
";",
"$",
"productIds",
"=",
"$",
"this",
"->",
"getSortedProductIds",
"(",
")",
";",
"if",
"(",
"$",
"productIds",
"&&",
"count",
"(",
"$",
"productIds",
")",
"... | Return a collection with all products manually sorted loaded.
@return \Magento\Catalog\Api\Data\ProductInterface[] | [
"Return",
"a",
"collection",
"with",
"all",
"products",
"manually",
"sorted",
"loaded",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ProductSorter/AbstractPreview.php#L171-L195 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php | Preview.getData | public function getData()
{
$baseResults = $this->getBaseResults();
$baseProducts = $this->preparePreviewItems($baseResults);
$optimizedResults = $this->canApply() ? $this->getOptimizedResults() : $baseResults;
$optimizedProducts = $this->preparePreviewItems($optimizedResults);
... | php | public function getData()
{
$baseResults = $this->getBaseResults();
$baseProducts = $this->preparePreviewItems($baseResults);
$optimizedResults = $this->canApply() ? $this->getOptimizedResults() : $baseResults;
$optimizedProducts = $this->preparePreviewItems($optimizedResults);
... | [
"public",
"function",
"getData",
"(",
")",
"{",
"$",
"baseResults",
"=",
"$",
"this",
"->",
"getBaseResults",
"(",
")",
";",
"$",
"baseProducts",
"=",
"$",
"this",
"->",
"preparePreviewItems",
"(",
"$",
"baseResults",
")",
";",
"$",
"optimizedResults",
"="... | Load preview data.
@return array | [
"Load",
"preview",
"data",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php#L110-L137 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php | Preview.getBaseResults | private function getBaseResults()
{
$baseApplier = $this->getApplier($this->optimizer, ProviderInterface::TYPE_EXCLUDE);
return $this->getPreviewResults($baseApplier);
} | php | private function getBaseResults()
{
$baseApplier = $this->getApplier($this->optimizer, ProviderInterface::TYPE_EXCLUDE);
return $this->getPreviewResults($baseApplier);
} | [
"private",
"function",
"getBaseResults",
"(",
")",
"{",
"$",
"baseApplier",
"=",
"$",
"this",
"->",
"getApplier",
"(",
"$",
"this",
"->",
"optimizer",
",",
"ProviderInterface",
"::",
"TYPE_EXCLUDE",
")",
";",
"return",
"$",
"this",
"->",
"getPreviewResults",
... | Load non-optimized results.
@return \Magento\Framework\Search\ResponseInterface | [
"Load",
"non",
"-",
"optimized",
"results",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php#L144-L149 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php | Preview.getOptimizedResults | private function getOptimizedResults()
{
$optimizedApplier = $this->getApplier($this->optimizer, ProviderInterface::TYPE_REPLACE);
return $this->getPreviewResults($optimizedApplier);
} | php | private function getOptimizedResults()
{
$optimizedApplier = $this->getApplier($this->optimizer, ProviderInterface::TYPE_REPLACE);
return $this->getPreviewResults($optimizedApplier);
} | [
"private",
"function",
"getOptimizedResults",
"(",
")",
"{",
"$",
"optimizedApplier",
"=",
"$",
"this",
"->",
"getApplier",
"(",
"$",
"this",
"->",
"optimizer",
",",
"ProviderInterface",
"::",
"TYPE_REPLACE",
")",
";",
"return",
"$",
"this",
"->",
"getPreviewR... | Load optimized results.
@return \Magento\Framework\Search\ResponseInterface | [
"Load",
"optimized",
"results",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php#L156-L161 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php | Preview.canApply | private function canApply()
{
$canApply = in_array($this->containerConfiguration->getName(), $this->optimizer->getSearchContainer());
if ($canApply && $this->containerConfiguration->getName() == 'quick_search_container') {
$config = $this->optimizer->getQuickSearchContainer();
... | php | private function canApply()
{
$canApply = in_array($this->containerConfiguration->getName(), $this->optimizer->getSearchContainer());
if ($canApply && $this->containerConfiguration->getName() == 'quick_search_container') {
$config = $this->optimizer->getQuickSearchContainer();
... | [
"private",
"function",
"canApply",
"(",
")",
"{",
"$",
"canApply",
"=",
"in_array",
"(",
"$",
"this",
"->",
"containerConfiguration",
"->",
"getName",
"(",
")",
",",
"$",
"this",
"->",
"optimizer",
"->",
"getSearchContainer",
"(",
")",
")",
";",
"if",
"(... | Indicates if the current optmizer can be applied to the search context.
@return boolean | [
"Indicates",
"if",
"the",
"current",
"optmizer",
"can",
"be",
"applied",
"to",
"the",
"search",
"context",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php#L168-L187 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php | Preview.getPreviewResults | private function getPreviewResults($applier)
{
return $this->previewResultsBuilder->getPreviewResults(
$this->containerConfiguration,
$applier,
$this->size,
$this->queryText,
$this->category
);
} | php | private function getPreviewResults($applier)
{
return $this->previewResultsBuilder->getPreviewResults(
$this->containerConfiguration,
$applier,
$this->size,
$this->queryText,
$this->category
);
} | [
"private",
"function",
"getPreviewResults",
"(",
"$",
"applier",
")",
"{",
"return",
"$",
"this",
"->",
"previewResultsBuilder",
"->",
"getPreviewResults",
"(",
"$",
"this",
"->",
"containerConfiguration",
",",
"$",
"applier",
",",
"$",
"this",
"->",
"size",
"... | @param ApplierList $applier Optimizer Applier
@return \Magento\Framework\Search\ResponseInterface | [
"@param",
"ApplierList",
"$applier",
"Optimizer",
"Applier"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php#L194-L203 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php | Preview.preparePreviewItems | private function preparePreviewItems(\Magento\Framework\Search\ResponseInterface $queryResponse)
{
$items = [];
foreach ($queryResponse->getIterator() as $document) {
$item = $this->previewItemFactory->create(['document' => $document]);
$items[$document-... | php | private function preparePreviewItems(\Magento\Framework\Search\ResponseInterface $queryResponse)
{
$items = [];
foreach ($queryResponse->getIterator() as $document) {
$item = $this->previewItemFactory->create(['document' => $document]);
$items[$document-... | [
"private",
"function",
"preparePreviewItems",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Search",
"\\",
"ResponseInterface",
"$",
"queryResponse",
")",
"{",
"$",
"items",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"queryResponse",
"->",
"getIterator",
"(",
... | Convert an array of products to an array of preview items.
@param \Magento\Framework\Search\ResponseInterface $queryResponse The Query response, with products as documents.
@return Preview\Item[] | [
"Convert",
"an",
"array",
"of",
"products",
"to",
"an",
"array",
"of",
"preview",
"items",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php#L212-L222 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php | Preview.getEffectOnProduct | private function getEffectOnProduct($baseProductIds, $optimizedProductIds, $productId)
{
$result = 0;
$baseProductPosition = array_search($productId, $baseProductIds);
$optimizedProductPosition = array_search($productId, $optimizedProductIds);
if ($baseProduct... | php | private function getEffectOnProduct($baseProductIds, $optimizedProductIds, $productId)
{
$result = 0;
$baseProductPosition = array_search($productId, $baseProductIds);
$optimizedProductPosition = array_search($productId, $optimizedProductIds);
if ($baseProduct... | [
"private",
"function",
"getEffectOnProduct",
"(",
"$",
"baseProductIds",
",",
"$",
"optimizedProductIds",
",",
"$",
"productId",
")",
"{",
"$",
"result",
"=",
"0",
";",
"$",
"baseProductPosition",
"=",
"array_search",
"(",
"$",
"productId",
",",
"$",
"baseProd... | Indicates if the product position have moved after optimization.
@param array $baseProductIds The base product Ids
@param array $optimizedProductIds The optimized product Ids.
@param int $productId The current product.
@return int | [
"Indicates",
"if",
"the",
"product",
"position",
"have",
"moved",
"after",
"optimization",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php#L233-L253 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php | Preview.getApplier | private function getApplier(OptimizerInterface $optimizer, $providerType)
{
$provider = $this->providerFactory->create($providerType, ['optimizer' => $optimizer]);
return $this->applierListFactory->create(['collectionProvider' => $provider]);
} | php | private function getApplier(OptimizerInterface $optimizer, $providerType)
{
$provider = $this->providerFactory->create($providerType, ['optimizer' => $optimizer]);
return $this->applierListFactory->create(['collectionProvider' => $provider]);
} | [
"private",
"function",
"getApplier",
"(",
"OptimizerInterface",
"$",
"optimizer",
",",
"$",
"providerType",
")",
"{",
"$",
"provider",
"=",
"$",
"this",
"->",
"providerFactory",
"->",
"create",
"(",
"$",
"providerType",
",",
"[",
"'optimizer'",
"=>",
"$",
"o... | Retrieve applier of a given type for an optimizer.
@param OptimizerInterface $optimizer The optimizer
@param string $providerType The provider type
@return \Smile\ElasticsuiteCatalogOptimizer\Model\Optimizer\ApplierList | [
"Retrieve",
"applier",
"of",
"a",
"given",
"type",
"for",
"an",
"optimizer",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview.php#L263-L268 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/Indexer/Category/Save/ReindexCategoryAfterSave.php | ReindexCategoryAfterSave.aroundReindex | public function aroundReindex(
\Magento\Catalog\Model\Category $subject,
callable $proceed
) {
$proceed();
if ($subject->getLevel() > 1) {
$categoryIndexer = $this->indexerRegistry->get(\Smile\ElasticsuiteCatalog\Model\Category\Indexer\Fulltext::INDEXER_ID);
... | php | public function aroundReindex(
\Magento\Catalog\Model\Category $subject,
callable $proceed
) {
$proceed();
if ($subject->getLevel() > 1) {
$categoryIndexer = $this->indexerRegistry->get(\Smile\ElasticsuiteCatalog\Model\Category\Indexer\Fulltext::INDEXER_ID);
... | [
"public",
"function",
"aroundReindex",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Category",
"$",
"subject",
",",
"callable",
"$",
"proceed",
")",
"{",
"$",
"proceed",
"(",
")",
";",
"if",
"(",
"$",
"subject",
"->",
"getLevel",
"(",
"... | Reindex category's data after into search engine after reindexing the category
@param \Magento\Catalog\Model\Category $subject The category being reindexed
@param callable $proceed The parent function we are plugged on
: Magento\Catalog\Model\Category::reindex()
@return \Magento\Catalog\Model\C... | [
"Reindex",
"category",
"s",
"data",
"after",
"into",
"search",
"engine",
"after",
"reindexing",
"the",
"category"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Indexer/Category/Save/ReindexCategoryAfterSave.php#L49-L63 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Reader/Container.php | Container.read | public function read($code = null)
{
$config = array_replace_recursive(
$this->defaultReader->read(ContainerScopeInterface::SCOPE_DEFAULT),
$this->initialConfig->getData($code)
);
$collection = $this->collectionFactory->create(
['scope' => ContainerScopeI... | php | public function read($code = null)
{
$config = array_replace_recursive(
$this->defaultReader->read(ContainerScopeInterface::SCOPE_DEFAULT),
$this->initialConfig->getData($code)
);
$collection = $this->collectionFactory->create(
['scope' => ContainerScopeI... | [
"public",
"function",
"read",
"(",
"$",
"code",
"=",
"null",
")",
"{",
"$",
"config",
"=",
"array_replace_recursive",
"(",
"$",
"this",
"->",
"defaultReader",
"->",
"read",
"(",
"ContainerScopeInterface",
"::",
"SCOPE_DEFAULT",
")",
",",
"$",
"this",
"->",
... | Read configuration by code
@param null|string $code The container code
@return array | [
"Read",
"configuration",
"by",
"code"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Reader/Container.php#L77-L100 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/Chart/Sessions.php | Sessions.getChartData | public function getChartData()
{
$data = [
'cols' => [
['type' => 'string', 'label' => __('Session type')],
['type' => 'number', 'label' => __('Count')],
],
'rows' => [],
];
try {
$reportData = $this->report->ge... | php | public function getChartData()
{
$data = [
'cols' => [
['type' => 'string', 'label' => __('Session type')],
['type' => 'number', 'label' => __('Count')],
],
'rows' => [],
];
try {
$reportData = $this->report->ge... | [
"public",
"function",
"getChartData",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"'cols'",
"=>",
"[",
"[",
"'type'",
"=>",
"'string'",
",",
"'label'",
"=>",
"__",
"(",
"'Session type'",
")",
"]",
",",
"[",
"'type'",
"=>",
"'number'",
",",
"'label'",
"=>",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/Chart/Sessions.php#L71-L111 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Block/Variables/Page/Order.php | Order.getVariables | public function getVariables()
{
$variables = [];
$order = $order = $this->checkoutSession->getLastRealOrder();
if ($order) {
$variables['order.subtotal'] = $order->getBaseSubtotalInclTax();
$variables['order.discount_total'] = $order->getDiscountAmount();
... | php | public function getVariables()
{
$variables = [];
$order = $order = $this->checkoutSession->getLastRealOrder();
if ($order) {
$variables['order.subtotal'] = $order->getBaseSubtotalInclTax();
$variables['order.discount_total'] = $order->getDiscountAmount();
... | [
"public",
"function",
"getVariables",
"(",
")",
"{",
"$",
"variables",
"=",
"[",
"]",
";",
"$",
"order",
"=",
"$",
"order",
"=",
"$",
"this",
"->",
"checkoutSession",
"->",
"getLastRealOrder",
"(",
")",
";",
"if",
"(",
"$",
"order",
")",
"{",
"$",
... | Return order and it's item related variables
@return array | [
"Return",
"order",
"and",
"it",
"s",
"item",
"related",
"variables"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Block/Variables/Page/Order.php#L62-L84 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Block/Variables/Page/Order.php | Order.getOrderItemVariables | private function getOrderItemVariables($item, $itemId)
{
$variables = [];
if (!$item->isDummy()) {
$prefix = "order.items.$itemId";
$variables[$prefix . '.sku'] = $item->getSku();
$variables[$prefix . '.product_id'] = $item->getProductId();
$va... | php | private function getOrderItemVariables($item, $itemId)
{
$variables = [];
if (!$item->isDummy()) {
$prefix = "order.items.$itemId";
$variables[$prefix . '.sku'] = $item->getSku();
$variables[$prefix . '.product_id'] = $item->getProductId();
$va... | [
"private",
"function",
"getOrderItemVariables",
"(",
"$",
"item",
",",
"$",
"itemId",
")",
"{",
"$",
"variables",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"$",
"item",
"->",
"isDummy",
"(",
")",
")",
"{",
"$",
"prefix",
"=",
"\"order.items.$itemId\"",
";",
... | Retrieve tracking variables for an order item
@param \Magento\Sales\Model\Order\Item $item The order item
@param int $itemId The order item id, dynamically generated.
@return array | [
"Retrieve",
"tracking",
"variables",
"for",
"an",
"order",
"item"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Block/Variables/Page/Order.php#L94-L118 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Mapper.php | Mapper.buildSearchRequest | public function buildSearchRequest(RequestInterface $request)
{
$searchRequest = [
'size' => $request->getSize(),
];
if ($searchRequest['size'] > 0) {
$searchRequest['sort'] = $this->getSortOrders($request);
$searchRequest['from'] = $request->getFrom();
... | php | public function buildSearchRequest(RequestInterface $request)
{
$searchRequest = [
'size' => $request->getSize(),
];
if ($searchRequest['size'] > 0) {
$searchRequest['sort'] = $this->getSortOrders($request);
$searchRequest['from'] = $request->getFrom();
... | [
"public",
"function",
"buildSearchRequest",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"searchRequest",
"=",
"[",
"'size'",
"=>",
"$",
"request",
"->",
"getSize",
"(",
")",
",",
"]",
";",
"if",
"(",
"$",
"searchRequest",
"[",
"'size'",
"]",
... | Transform the search request into an ES request.
@param RequestInterface $request Search Request.
@return array | [
"Transform",
"the",
"search",
"request",
"into",
"an",
"ES",
"request",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Mapper.php#L70-L97 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Mapper.php | Mapper.getRootFilter | private function getRootFilter(RequestInterface $request)
{
$filter = null;
if ($request->getFilter()) {
$filter = $this->queryBuilder->buildQuery($request->getFilter());
}
return $filter;
} | php | private function getRootFilter(RequestInterface $request)
{
$filter = null;
if ($request->getFilter()) {
$filter = $this->queryBuilder->buildQuery($request->getFilter());
}
return $filter;
} | [
"private",
"function",
"getRootFilter",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"filter",
"=",
"null",
";",
"if",
"(",
"$",
"request",
"->",
"getFilter",
"(",
")",
")",
"{",
"$",
"filter",
"=",
"$",
"this",
"->",
"queryBuilder",
"->",
"... | Extract and build the root filter of the search request.
@param RequestInterface $request Search request.
@return array | [
"Extract",
"and",
"build",
"the",
"root",
"filter",
"of",
"the",
"search",
"request",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Mapper.php#L119-L128 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Mapper.php | Mapper.getSortOrders | private function getSortOrders(RequestInterface $request)
{
$sortOrders = [];
if ($request->getSortOrders()) {
$sortOrders = $this->sortOrderBuilder->buildSortOrders($request->getSortOrders());
}
return $sortOrders;
} | php | private function getSortOrders(RequestInterface $request)
{
$sortOrders = [];
if ($request->getSortOrders()) {
$sortOrders = $this->sortOrderBuilder->buildSortOrders($request->getSortOrders());
}
return $sortOrders;
} | [
"private",
"function",
"getSortOrders",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"sortOrders",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"request",
"->",
"getSortOrders",
"(",
")",
")",
"{",
"$",
"sortOrders",
"=",
"$",
"this",
"->",
"sortOrderB... | Extract and build sort orders of the search request.
@param RequestInterface $request Search request.
@return array | [
"Extract",
"and",
"build",
"sort",
"orders",
"of",
"the",
"search",
"request",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Mapper.php#L137-L146 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Mapper.php | Mapper.getAggregations | private function getAggregations(RequestInterface $request)
{
$aggregations = [];
if ($request->getAggregation()) {
$aggregations = $this->aggregationBuilder->buildAggregations($request->getAggregation());
}
return $aggregations;
} | php | private function getAggregations(RequestInterface $request)
{
$aggregations = [];
if ($request->getAggregation()) {
$aggregations = $this->aggregationBuilder->buildAggregations($request->getAggregation());
}
return $aggregations;
} | [
"private",
"function",
"getAggregations",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"aggregations",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"request",
"->",
"getAggregation",
"(",
")",
")",
"{",
"$",
"aggregations",
"=",
"$",
"this",
"->",
"agg... | Extract and build aggregations of the search request.
@param RequestInterface $request Search request.
@return array | [
"Extract",
"and",
"build",
"aggregations",
"of",
"the",
"search",
"request",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Mapper.php#L155-L164 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Indexer/GenericIndexerHandler.php | GenericIndexerHandler.saveIndex | public function saveIndex($dimensions, \Traversable $documents)
{
foreach ($dimensions as $dimension) {
$storeId = $dimension->getValue();
try {
$index = $this->indexOperation->getIndexByName($this->indexName, $storeId);
} catch (\Exception $e) {
... | php | public function saveIndex($dimensions, \Traversable $documents)
{
foreach ($dimensions as $dimension) {
$storeId = $dimension->getValue();
try {
$index = $this->indexOperation->getIndexByName($this->indexName, $storeId);
} catch (\Exception $e) {
... | [
"public",
"function",
"saveIndex",
"(",
"$",
"dimensions",
",",
"\\",
"Traversable",
"$",
"documents",
")",
"{",
"foreach",
"(",
"$",
"dimensions",
"as",
"$",
"dimension",
")",
"{",
"$",
"storeId",
"=",
"$",
"dimension",
"->",
"getValue",
"(",
")",
";",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Indexer/GenericIndexerHandler.php#L102-L135 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Indexer/GenericIndexerHandler.php | GenericIndexerHandler.deleteIndex | public function deleteIndex($dimensions, \Traversable $documents)
{
foreach ($dimensions as $dimension) {
$storeId = $dimension->getValue();
if ($this->indexOperation->indexExists($this->indexName, $storeId)) {
$index = $this->indexOperation->getIndexByName($th... | php | public function deleteIndex($dimensions, \Traversable $documents)
{
foreach ($dimensions as $dimension) {
$storeId = $dimension->getValue();
if ($this->indexOperation->indexExists($this->indexName, $storeId)) {
$index = $this->indexOperation->getIndexByName($th... | [
"public",
"function",
"deleteIndex",
"(",
"$",
"dimensions",
",",
"\\",
"Traversable",
"$",
"documents",
")",
"{",
"foreach",
"(",
"$",
"dimensions",
"as",
"$",
"dimension",
")",
"{",
"$",
"storeId",
"=",
"$",
"dimension",
"->",
"getValue",
"(",
")",
";"... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Indexer/GenericIndexerHandler.php#L140-L160 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Indexer/GenericIndexerHandler.php | GenericIndexerHandler.cleanIndex | public function cleanIndex($dimensions)
{
foreach ($dimensions as $dimension) {
$this->indexOperation->createIndex($this->indexName, $dimension->getValue());
}
return $this;
} | php | public function cleanIndex($dimensions)
{
foreach ($dimensions as $dimension) {
$this->indexOperation->createIndex($this->indexName, $dimension->getValue());
}
return $this;
} | [
"public",
"function",
"cleanIndex",
"(",
"$",
"dimensions",
")",
"{",
"foreach",
"(",
"$",
"dimensions",
"as",
"$",
"dimension",
")",
"{",
"$",
"this",
"->",
"indexOperation",
"->",
"createIndex",
"(",
"$",
"this",
"->",
"indexName",
",",
"$",
"dimension",... | This override does not delete data into the old index as expected but only create a new index.
It allows to keep old index in place during full reindex.
{@inheritDoc} | [
"This",
"override",
"does",
"not",
"delete",
"data",
"into",
"the",
"old",
"index",
"as",
"expected",
"but",
"only",
"create",
"a",
"new",
"index",
".",
"It",
"allows",
"to",
"keep",
"old",
"index",
"in",
"place",
"during",
"full",
"reindex",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Indexer/GenericIndexerHandler.php#L168-L175 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Indexer/GenericIndexerHandler.php | GenericIndexerHandler.getDatasources | private function getDatasources($indexName)
{
$config = $this->indexSettings->getIndexConfig($indexName);
$legacyDatasources = $config['datasources'] ?? [];
$resolver = $this->dataSourceResolverFactory->create(['legacyDataSources' => [$indexName => $legacyDatasources]]);
... | php | private function getDatasources($indexName)
{
$config = $this->indexSettings->getIndexConfig($indexName);
$legacyDatasources = $config['datasources'] ?? [];
$resolver = $this->dataSourceResolverFactory->create(['legacyDataSources' => [$indexName => $legacyDatasources]]);
... | [
"private",
"function",
"getDatasources",
"(",
"$",
"indexName",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"indexSettings",
"->",
"getIndexConfig",
"(",
"$",
"indexName",
")",
";",
"$",
"legacyDatasources",
"=",
"$",
"config",
"[",
"'datasources'",
"]"... | Retrieve data sources of an index by name.
@deprecated
@param string $indexName The index name
@return \Smile\ElasticsuiteCore\Api\Index\DatasourceInterface[] | [
"Retrieve",
"data",
"sources",
"of",
"an",
"index",
"by",
"name",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Indexer/GenericIndexerHandler.php#L194-L203 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Category.php | Category.getUrl | public function getUrl()
{
$catRequestVar = $this->getFilter()->getRequestVar();
$pageRequestVar = $this->_htmlPagerBlock->getPageVarName();
$queryParams = [
$catRequestVar => $this->getValue(),
$pageRequestVar => null,
];
foreach ($this->getFilter... | php | public function getUrl()
{
$catRequestVar = $this->getFilter()->getRequestVar();
$pageRequestVar = $this->_htmlPagerBlock->getPageVarName();
$queryParams = [
$catRequestVar => $this->getValue(),
$pageRequestVar => null,
];
foreach ($this->getFilter... | [
"public",
"function",
"getUrl",
"(",
")",
"{",
"$",
"catRequestVar",
"=",
"$",
"this",
"->",
"getFilter",
"(",
")",
"->",
"getRequestVar",
"(",
")",
";",
"$",
"pageRequestVar",
"=",
"$",
"this",
"->",
"_htmlPagerBlock",
"->",
"getPageVarName",
"(",
")",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Item/Category.php#L29-L57 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Controller/Adminhtml/Term/Merchandiser/Save.php | Save.execute | public function execute()
{
$queryId = $this->getRequest()->getParam('query_id');
$sortedProducts = $this->getRequest()->getParam('sorted_products', []);
$blacklistedProducts = $this->getRequest()->getParam('blacklisted_products', []);
if (is_string($sortedProducts)... | php | public function execute()
{
$queryId = $this->getRequest()->getParam('query_id');
$sortedProducts = $this->getRequest()->getParam('sorted_products', []);
$blacklistedProducts = $this->getRequest()->getParam('blacklisted_products', []);
if (is_string($sortedProducts)... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"queryId",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",
"'query_id'",
")",
";",
"$",
"sortedProducts",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Controller/Adminhtml/Term/Merchandiser/Save.php#L55-L84 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request.php | Request.isSpellchecked | public function isSpellchecked()
{
$fuzzySpellingTypes = [
SpellcheckerInterface::SPELLING_TYPE_FUZZY,
SpellcheckerInterface::SPELLING_TYPE_MOST_FUZZY,
];
return in_array($this->spellingType, $fuzzySpellingTypes);
} | php | public function isSpellchecked()
{
$fuzzySpellingTypes = [
SpellcheckerInterface::SPELLING_TYPE_FUZZY,
SpellcheckerInterface::SPELLING_TYPE_MOST_FUZZY,
];
return in_array($this->spellingType, $fuzzySpellingTypes);
} | [
"public",
"function",
"isSpellchecked",
"(",
")",
"{",
"$",
"fuzzySpellingTypes",
"=",
"[",
"SpellcheckerInterface",
"::",
"SPELLING_TYPE_FUZZY",
",",
"SpellcheckerInterface",
"::",
"SPELLING_TYPE_MOST_FUZZY",
",",
"]",
";",
"return",
"in_array",
"(",
"$",
"this",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request.php#L119-L127 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Setup/InstallSchema.php | InstallSchema.install | public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$this->catalogSetup->addEavCatalogFields($setup);
$this->catalogSetup->addIsSpellcheckedToSearchQuery($setup);
// Introduced in version 1.1.0.
$this->catalogSetup->a... | php | public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$this->catalogSetup->addEavCatalogFields($setup);
$this->catalogSetup->addIsSpellcheckedToSearchQuery($setup);
// Introduced in version 1.1.0.
$this->catalogSetup->a... | [
"public",
"function",
"install",
"(",
"SchemaSetupInterface",
"$",
"setup",
",",
"ModuleContextInterface",
"$",
"context",
")",
"{",
"$",
"setup",
"->",
"startSetup",
"(",
")",
";",
"$",
"this",
"->",
"catalogSetup",
"->",
"addEavCatalogFields",
"(",
"$",
"set... | Installs DB schema for the module
@SuppressWarnings(PHPMD.UnusedFormalParameter)
@param SchemaSetupInterface $setup The setup interface
@param ModuleContextInterface $context The module Context
@return void | [
"Installs",
"DB",
"schema",
"for",
"the",
"module"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Setup/InstallSchema.php#L57-L76 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/Missing.php | Missing.buildQuery | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_MISSING) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$searchQuery = ['bool' => ['must_not' => ['exists' => ['field' => $query... | php | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_MISSING) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$searchQuery = ['bool' => ['must_not' => ['exists' => ['field' => $query... | [
"public",
"function",
"buildQuery",
"(",
"QueryInterface",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"->",
"getType",
"(",
")",
"!==",
"QueryInterface",
"::",
"TYPE_MISSING",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Query buil... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/Missing.php#L32-L45 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Controller/Tracker/Hit.php | Hit.execute | public function execute()
{
$this->getResponse()->setBody(base64_decode(self::PIXEL));
$this->getResponse()->setHeader('Content-Type', 'image/png');
$this->getResponse()->sendResponse();
$eventData = $this->decodeParams($this->getRequest()->getParams());
$this->trackingServ... | php | public function execute()
{
$this->getResponse()->setBody(base64_decode(self::PIXEL));
$this->getResponse()->setHeader('Content-Type', 'image/png');
$this->getResponse()->sendResponse();
$eventData = $this->decodeParams($this->getRequest()->getParams());
$this->trackingServ... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"this",
"->",
"getResponse",
"(",
")",
"->",
"setBody",
"(",
"base64_decode",
"(",
"self",
"::",
"PIXEL",
")",
")",
";",
"$",
"this",
"->",
"getResponse",
"(",
")",
"->",
"setHeader",
"(",
"'Content-... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Controller/Tracker/Hit.php#L53-L62 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Controller/Tracker/Hit.php | Hit.decodeParams | private function decodeParams($params)
{
if (is_string($params)) {
$params = urldecode($params);
} elseif (is_array($params)) {
foreach ($params as &$currentParam) {
$currentParam = $this->decodeParams($currentParam);
}
}
return $p... | php | private function decodeParams($params)
{
if (is_string($params)) {
$params = urldecode($params);
} elseif (is_array($params)) {
foreach ($params as &$currentParam) {
$currentParam = $this->decodeParams($currentParam);
}
}
return $p... | [
"private",
"function",
"decodeParams",
"(",
"$",
"params",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"params",
")",
")",
"{",
"$",
"params",
"=",
"urldecode",
"(",
"$",
"params",
")",
";",
"}",
"elseif",
"(",
"is_array",
"(",
"$",
"params",
")",
... | Decode URI params.
@param mixed $params Params.
@return mixed | [
"Decode",
"URI",
"params",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Controller/Tracker/Hit.php#L71-L82 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Setup/ThesaurusSetup.php | ThesaurusSetup.createThesaurusTable | public function createThesaurusTable(SchemaSetupInterface $setup)
{
$table = $setup->getConnection()
->newTable($setup->getTable(ThesaurusInterface::TABLE_NAME))
->addColumn(
ThesaurusInterface::THESAURUS_ID,
\Magento\Framework\DB\Ddl\Table::TYPE_INTEG... | php | public function createThesaurusTable(SchemaSetupInterface $setup)
{
$table = $setup->getConnection()
->newTable($setup->getTable(ThesaurusInterface::TABLE_NAME))
->addColumn(
ThesaurusInterface::THESAURUS_ID,
\Magento\Framework\DB\Ddl\Table::TYPE_INTEG... | [
"public",
"function",
"createThesaurusTable",
"(",
"SchemaSetupInterface",
"$",
"setup",
")",
"{",
"$",
"table",
"=",
"$",
"setup",
"->",
"getConnection",
"(",
")",
"->",
"newTable",
"(",
"$",
"setup",
"->",
"getTable",
"(",
"ThesaurusInterface",
"::",
"TABLE_... | Create Thesaurus main table
@param \Magento\Framework\Setup\SchemaSetupInterface $setup Setup instance | [
"Create",
"Thesaurus",
"main",
"table"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Setup/ThesaurusSetup.php#L33-L58 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Setup/ThesaurusSetup.php | ThesaurusSetup.createThesaurusStoreTable | public function createThesaurusStoreTable(SchemaSetupInterface $setup)
{
$table = $setup->getConnection()
->newTable($setup->getTable(ThesaurusInterface::STORE_TABLE_NAME))
->addColumn(
ThesaurusInterface::THESAURUS_ID,
\Magento\Framework\DB\Ddl\Table:... | php | public function createThesaurusStoreTable(SchemaSetupInterface $setup)
{
$table = $setup->getConnection()
->newTable($setup->getTable(ThesaurusInterface::STORE_TABLE_NAME))
->addColumn(
ThesaurusInterface::THESAURUS_ID,
\Magento\Framework\DB\Ddl\Table:... | [
"public",
"function",
"createThesaurusStoreTable",
"(",
"SchemaSetupInterface",
"$",
"setup",
")",
"{",
"$",
"table",
"=",
"$",
"setup",
"->",
"getConnection",
"(",
")",
"->",
"newTable",
"(",
"$",
"setup",
"->",
"getTable",
"(",
"ThesaurusInterface",
"::",
"S... | Create Thesaurus/store link table
@param \Magento\Framework\Setup\SchemaSetupInterface $setup Setup instance | [
"Create",
"Thesaurus",
"/",
"store",
"link",
"table"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Setup/ThesaurusSetup.php#L65-L101 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Setup/ThesaurusSetup.php | ThesaurusSetup.createExpansionReferenceTable | public function createExpansionReferenceTable(SchemaSetupInterface $setup)
{
$table = $setup->getConnection()
->newTable($setup->getTable(ThesaurusInterface::REFERENCE_TABLE_NAME))
->addColumn(
ThesaurusInterface::THESAURUS_ID,
\Magento\Framework\DB\Dd... | php | public function createExpansionReferenceTable(SchemaSetupInterface $setup)
{
$table = $setup->getConnection()
->newTable($setup->getTable(ThesaurusInterface::REFERENCE_TABLE_NAME))
->addColumn(
ThesaurusInterface::THESAURUS_ID,
\Magento\Framework\DB\Dd... | [
"public",
"function",
"createExpansionReferenceTable",
"(",
"SchemaSetupInterface",
"$",
"setup",
")",
"{",
"$",
"table",
"=",
"$",
"setup",
"->",
"getConnection",
"(",
")",
"->",
"newTable",
"(",
"$",
"setup",
"->",
"getTable",
"(",
"ThesaurusInterface",
"::",
... | Create Thesaurus/expansion reference terms link table
@param \Magento\Framework\Setup\SchemaSetupInterface $setup Setup instance | [
"Create",
"Thesaurus",
"/",
"expansion",
"reference",
"terms",
"link",
"table"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Setup/ThesaurusSetup.php#L108-L145 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Setup/ThesaurusSetup.php | ThesaurusSetup.appendIsActiveColumn | public function appendIsActiveColumn(SchemaSetupInterface $setup)
{
$setup->getConnection()->addColumn(
$setup->getTable(ThesaurusInterface::TABLE_NAME),
ThesaurusInterface::IS_ACTIVE,
[
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
... | php | public function appendIsActiveColumn(SchemaSetupInterface $setup)
{
$setup->getConnection()->addColumn(
$setup->getTable(ThesaurusInterface::TABLE_NAME),
ThesaurusInterface::IS_ACTIVE,
[
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT,
... | [
"public",
"function",
"appendIsActiveColumn",
"(",
"SchemaSetupInterface",
"$",
"setup",
")",
"{",
"$",
"setup",
"->",
"getConnection",
"(",
")",
"->",
"addColumn",
"(",
"$",
"setup",
"->",
"getTable",
"(",
"ThesaurusInterface",
"::",
"TABLE_NAME",
")",
",",
"... | Add an "is_active" column to the Thesaurus table.
@param \Magento\Framework\Setup\SchemaSetupInterface $setup Setup instance | [
"Add",
"an",
"is_active",
"column",
"to",
"the",
"Thesaurus",
"table",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Setup/ThesaurusSetup.php#L199-L211 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/PriceData.php | PriceData.loadPriceData | public function loadPriceData($storeId, $productIds)
{
$websiteId = $this->getStore($storeId)->getWebsiteId();
$baseSelects = [];
foreach ($this->getPriceIndexDimensionsTables($websiteId) as $dimensionsTable) {
$baseSelects[] = $this->getLoadPriceDataSelect($dimensionsTable, $we... | php | public function loadPriceData($storeId, $productIds)
{
$websiteId = $this->getStore($storeId)->getWebsiteId();
$baseSelects = [];
foreach ($this->getPriceIndexDimensionsTables($websiteId) as $dimensionsTable) {
$baseSelects[] = $this->getLoadPriceDataSelect($dimensionsTable, $we... | [
"public",
"function",
"loadPriceData",
"(",
"$",
"storeId",
",",
"$",
"productIds",
")",
"{",
"$",
"websiteId",
"=",
"$",
"this",
"->",
"getStore",
"(",
"$",
"storeId",
")",
"->",
"getWebsiteId",
"(",
")",
";",
"$",
"baseSelects",
"=",
"[",
"]",
";",
... | Load prices data for a list of product ids and a given store.
@param integer $storeId Store id.
@param array $productIds Product ids list.
@return array | [
"Load",
"prices",
"data",
"for",
"a",
"list",
"of",
"product",
"ids",
"and",
"a",
"given",
"store",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/PriceData.php#L85-L96 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/PriceData.php | PriceData.getLoadPriceDataSelect | private function getLoadPriceDataSelect($indexTable, $websiteId, $productIds)
{
$select = $this->getConnection()->select()
->from(['p' => $indexTable])
->where('p.website_id = ?', $websiteId)
->where('p.entity_id IN(?)', $productIds);
return $select;
} | php | private function getLoadPriceDataSelect($indexTable, $websiteId, $productIds)
{
$select = $this->getConnection()->select()
->from(['p' => $indexTable])
->where('p.website_id = ?', $websiteId)
->where('p.entity_id IN(?)', $productIds);
return $select;
} | [
"private",
"function",
"getLoadPriceDataSelect",
"(",
"$",
"indexTable",
",",
"$",
"websiteId",
",",
"$",
"productIds",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"select",
"(",
")",
"->",
"from",
"(",
"[",
"'p'",
... | Return a single price loading query against a specific price index table.
@param string $indexTable Price index table.
@param integer $websiteId Website id.
@param array $productIds Product ids list.
@return \Magento\Framework\DB\Select | [
"Return",
"a",
"single",
"price",
"loading",
"query",
"against",
"a",
"specific",
"price",
"index",
"table",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/PriceData.php#L107-L115 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/PriceData.php | PriceData.getPriceIndexDimensionsTables | private function getPriceIndexDimensionsTables($websiteId)
{
$tables = [];
$indexDimensions = $this->getPriceIndexDimensions($websiteId);
foreach ($indexDimensions as $dimensions) {
$tables[] = $this->priceTableResolver->resolve('catalog_product_index_price', $dimensions);
... | php | private function getPriceIndexDimensionsTables($websiteId)
{
$tables = [];
$indexDimensions = $this->getPriceIndexDimensions($websiteId);
foreach ($indexDimensions as $dimensions) {
$tables[] = $this->priceTableResolver->resolve('catalog_product_index_price', $dimensions);
... | [
"private",
"function",
"getPriceIndexDimensionsTables",
"(",
"$",
"websiteId",
")",
"{",
"$",
"tables",
"=",
"[",
"]",
";",
"$",
"indexDimensions",
"=",
"$",
"this",
"->",
"getPriceIndexDimensions",
"(",
"$",
"websiteId",
")",
";",
"foreach",
"(",
"$",
"inde... | Return the price index tables according to the price index dimensions for the given website.
@param integer $websiteId Website id.
@return array | [
"Return",
"the",
"price",
"index",
"tables",
"according",
"to",
"the",
"price",
"index",
"dimensions",
"for",
"the",
"given",
"website",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/PriceData.php#L124-L134 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/PriceData.php | PriceData.getPriceIndexDimensions | private function getPriceIndexDimensions($websiteId)
{
if (!array_key_exists($websiteId, $this->dimensionsByWebsite)) {
$indexDimensions = $this->getAllPriceIndexDimensions();
$relevantDimensions = [];
foreach ($indexDimensions as $dimensions) {
if (array... | php | private function getPriceIndexDimensions($websiteId)
{
if (!array_key_exists($websiteId, $this->dimensionsByWebsite)) {
$indexDimensions = $this->getAllPriceIndexDimensions();
$relevantDimensions = [];
foreach ($indexDimensions as $dimensions) {
if (array... | [
"private",
"function",
"getPriceIndexDimensions",
"(",
"$",
"websiteId",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"websiteId",
",",
"$",
"this",
"->",
"dimensionsByWebsite",
")",
")",
"{",
"$",
"indexDimensions",
"=",
"$",
"this",
"->",
"getAl... | Return price index dimensions applicable for the given website.
@param integer $websiteId Website id.
@return array
@SuppressWarnings(PHPMD.ElseExpression) | [
"Return",
"price",
"index",
"dimensions",
"applicable",
"for",
"the",
"given",
"website",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/PriceData.php#L144-L165 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/PriceData.php | PriceData.getAllPriceIndexDimensions | private function getAllPriceIndexDimensions()
{
if ($this->dimensions === null) {
$this->dimensions = $this->dimensionCollectionFactory->create();
}
return $this->dimensions;
} | php | private function getAllPriceIndexDimensions()
{
if ($this->dimensions === null) {
$this->dimensions = $this->dimensionCollectionFactory->create();
}
return $this->dimensions;
} | [
"private",
"function",
"getAllPriceIndexDimensions",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dimensions",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"dimensions",
"=",
"$",
"this",
"->",
"dimensionCollectionFactory",
"->",
"create",
"(",
")",
";",
"... | Return all price index dimensions.
@return array | [
"Return",
"all",
"price",
"index",
"dimensions",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/PriceData.php#L172-L179 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Autocomplete/Category/ItemFactory.php | ItemFactory.create | public function create(array $data)
{
$data = $this->addCategoryData($data);
unset($data['category']);
return parent::create($data);
} | php | public function create(array $data)
{
$data = $this->addCategoryData($data);
unset($data['category']);
return parent::create($data);
} | [
"public",
"function",
"create",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"addCategoryData",
"(",
"$",
"data",
")",
";",
"unset",
"(",
"$",
"data",
"[",
"'category'",
"]",
")",
";",
"return",
"parent",
"::",
"create",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Category/ItemFactory.php#L79-L85 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Autocomplete/Category/ItemFactory.php | ItemFactory.addCategoryData | private function addCategoryData($data)
{
$category = $data['category'];
$documentSource = $category->getDocumentSource();
$title = $documentSource['name'];
if (is_array($title)) {
$title = current($title);
}
$categoryData = [
'title' =... | php | private function addCategoryData($data)
{
$category = $data['category'];
$documentSource = $category->getDocumentSource();
$title = $documentSource['name'];
if (is_array($title)) {
$title = current($title);
}
$categoryData = [
'title' =... | [
"private",
"function",
"addCategoryData",
"(",
"$",
"data",
")",
"{",
"$",
"category",
"=",
"$",
"data",
"[",
"'category'",
"]",
";",
"$",
"documentSource",
"=",
"$",
"category",
"->",
"getDocumentSource",
"(",
")",
";",
"$",
"title",
"=",
"$",
"document... | Load category data and append them to the original data.
@param array $data Autocomplete item data.
@return array | [
"Load",
"category",
"data",
"and",
"append",
"them",
"to",
"the",
"original",
"data",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Category/ItemFactory.php#L94-L114 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Autocomplete/Category/ItemFactory.php | ItemFactory.getCategoryUrl | private function getCategoryUrl($category)
{
$documentSource = $category->getDocumentSource();
if ($documentSource && isset($documentSource['url_path'])) {
$urlPath = is_array($documentSource['url_path']) ? current($documentSource['url_path']) : $documentSource['url_path'];
... | php | private function getCategoryUrl($category)
{
$documentSource = $category->getDocumentSource();
if ($documentSource && isset($documentSource['url_path'])) {
$urlPath = is_array($documentSource['url_path']) ? current($documentSource['url_path']) : $documentSource['url_path'];
... | [
"private",
"function",
"getCategoryUrl",
"(",
"$",
"category",
")",
"{",
"$",
"documentSource",
"=",
"$",
"category",
"->",
"getDocumentSource",
"(",
")",
";",
"if",
"(",
"$",
"documentSource",
"&&",
"isset",
"(",
"$",
"documentSource",
"[",
"'url_path'",
"]... | Retrieve category Url from the document source.
Done from the document source to prevent having to use addUrlRewrite to result on category collection.
@param \Magento\Catalog\Model\Category $category The category.
@return string | [
"Retrieve",
"category",
"Url",
"from",
"the",
"document",
"source",
".",
"Done",
"from",
"the",
"document",
"source",
"to",
"prevent",
"having",
"to",
"use",
"addUrlRewrite",
"to",
"result",
"on",
"category",
"collection",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Category/ItemFactory.php#L124-L137 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Autocomplete/Category/ItemFactory.php | ItemFactory.getCategoryBreadcrumb | private function getCategoryBreadcrumb(\Magento\Catalog\Model\Category $category)
{
$path = $category->getPath();
$rawPath = explode('/', $path);
// First occurence is root category (1), second is root category of store.
$rawPath = array_slice($rawPath, 2);
// Last occur... | php | private function getCategoryBreadcrumb(\Magento\Catalog\Model\Category $category)
{
$path = $category->getPath();
$rawPath = explode('/', $path);
// First occurence is root category (1), second is root category of store.
$rawPath = array_slice($rawPath, 2);
// Last occur... | [
"private",
"function",
"getCategoryBreadcrumb",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Category",
"$",
"category",
")",
"{",
"$",
"path",
"=",
"$",
"category",
"->",
"getPath",
"(",
")",
";",
"$",
"rawPath",
"=",
"explode",
"(",
"'/... | Return a mini-breadcrumb for a category
@param \Magento\Catalog\Model\Category $category The category
@return array | [
"Return",
"a",
"mini",
"-",
"breadcrumb",
"for",
"a",
"category"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Category/ItemFactory.php#L146-L163 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Autocomplete/Category/ItemFactory.php | ItemFactory.getCategoryNameById | private function getCategoryNameById($categoryId, $storeId)
{
if (!isset($this->categoryNames[$categoryId])) {
$categoryResource = $this->categoryResource;
$this->categoryNames[$categoryId] = $categoryResource->getAttributeRawValue($categoryId, "name", $storeId);
}
r... | php | private function getCategoryNameById($categoryId, $storeId)
{
if (!isset($this->categoryNames[$categoryId])) {
$categoryResource = $this->categoryResource;
$this->categoryNames[$categoryId] = $categoryResource->getAttributeRawValue($categoryId, "name", $storeId);
}
r... | [
"private",
"function",
"getCategoryNameById",
"(",
"$",
"categoryId",
",",
"$",
"storeId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"categoryNames",
"[",
"$",
"categoryId",
"]",
")",
")",
"{",
"$",
"categoryResource",
"=",
"$",
"this",
... | Retrieve a category name by it's id, and store it in local cache
@param int $categoryId The category Id
@param int $storeId The store Id
@return string | [
"Retrieve",
"a",
"category",
"name",
"by",
"it",
"s",
"id",
"and",
"store",
"it",
"in",
"local",
"cache"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Autocomplete/Category/ItemFactory.php#L173-L181 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Advanced/Collection.php | Collection.addFieldsToFilter | public function addFieldsToFilter($fields)
{
if ($fields) {
foreach ($fields as $fieldByType) {
foreach ($fieldByType as $attributeId => $condition) {
$attributeCode = $this->getEntity()->getAttribute($attributeId)->getAttributeCode();
$con... | php | public function addFieldsToFilter($fields)
{
if ($fields) {
foreach ($fields as $fieldByType) {
foreach ($fieldByType as $attributeId => $condition) {
$attributeCode = $this->getEntity()->getAttribute($attributeId)->getAttributeCode();
$con... | [
"public",
"function",
"addFieldsToFilter",
"(",
"$",
"fields",
")",
"{",
"if",
"(",
"$",
"fields",
")",
"{",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"fieldByType",
")",
"{",
"foreach",
"(",
"$",
"fieldByType",
"as",
"$",
"attributeId",
"=>",
"$",
"co... | Add multiple fields to filter
@param array $fields The fields to filter
@return $this | [
"Add",
"multiple",
"fields",
"to",
"filter"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Advanced/Collection.php#L36-L52 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Advanced/Collection.php | Collection.cleanCondition | private function cleanCondition($condition)
{
if (is_array($condition)) {
$condition = array_filter($condition);
if (empty($condition)) {
$condition = null;
}
}
return $condition;
} | php | private function cleanCondition($condition)
{
if (is_array($condition)) {
$condition = array_filter($condition);
if (empty($condition)) {
$condition = null;
}
}
return $condition;
} | [
"private",
"function",
"cleanCondition",
"(",
"$",
"condition",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"condition",
")",
")",
"{",
"$",
"condition",
"=",
"array_filter",
"(",
"$",
"condition",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"condition",
")... | Ensure proper building of condition
@param array|string $condition The condition to apply
@return array|string|null | [
"Ensure",
"proper",
"building",
"of",
"condition"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Advanced/Collection.php#L61-L71 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Controller/Adminhtml/Search/Usage.php | Usage.execute | public function execute()
{
$indexIdentifiers = [SessionIndexInterface::INDEX_IDENTIFIER, EventIndexInterface::INDEX_IDENTIFIER];
foreach ($indexIdentifiers as $indexIdentifier) {
if (!$this->checkIndexPresence($indexIdentifier)) {
$this->messageManager->addWarningMessage... | php | public function execute()
{
$indexIdentifiers = [SessionIndexInterface::INDEX_IDENTIFIER, EventIndexInterface::INDEX_IDENTIFIER];
foreach ($indexIdentifiers as $indexIdentifier) {
if (!$this->checkIndexPresence($indexIdentifier)) {
$this->messageManager->addWarningMessage... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"indexIdentifiers",
"=",
"[",
"SessionIndexInterface",
"::",
"INDEX_IDENTIFIER",
",",
"EventIndexInterface",
"::",
"INDEX_IDENTIFIER",
"]",
";",
"foreach",
"(",
"$",
"indexIdentifiers",
"as",
"$",
"indexIdentifier... | 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-analytics/Controller/Adminhtml/Search/Usage.php#L73-L91 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Collection/Provider/Exclude.php | Exclude.getCollection | public function getCollection(ContainerConfigurationInterface $containerConfiguration)
{
$collection = $this->optimizerCollectionFactory->create();
$collection->addFieldToFilter(OptimizerInterface::STORE_ID, $containerConfiguration->getStoreId())
->addSearchContainersFilter($containerCo... | php | public function getCollection(ContainerConfigurationInterface $containerConfiguration)
{
$collection = $this->optimizerCollectionFactory->create();
$collection->addFieldToFilter(OptimizerInterface::STORE_ID, $containerConfiguration->getStoreId())
->addSearchContainersFilter($containerCo... | [
"public",
"function",
"getCollection",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"optimizerCollectionFactory",
"->",
"create",
"(",
")",
";",
"$",
"collection",
"->",
"addFieldToFilter",... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Collection/Provider/Exclude.php#L63-L73 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/CategoryQuery.php | CategoryQuery.getCategorySearchQuery | public function getCategorySearchQuery(
ContainerConfigurationInterface $containerConfigurationInterface,
CategoryInterface $category
) {
$filters = array_merge(
['category' => $this->categoryFilterProvider->getQueryFilter($category)],
$containerConfigurationInterface... | php | public function getCategorySearchQuery(
ContainerConfigurationInterface $containerConfigurationInterface,
CategoryInterface $category
) {
$filters = array_merge(
['category' => $this->categoryFilterProvider->getQueryFilter($category)],
$containerConfigurationInterface... | [
"public",
"function",
"getCategorySearchQuery",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfigurationInterface",
",",
"CategoryInterface",
"$",
"category",
")",
"{",
"$",
"filters",
"=",
"array_merge",
"(",
"[",
"'category'",
"=>",
"$",
"this",
"->",
"c... | Retrieve Search Query for a category
@param ContainerConfigurationInterface $containerConfigurationInterface Container Configuration
@param CategoryInterface $category Category
@return QueryInterface | [
"Retrieve",
"Search",
"Query",
"for",
"a",
"category"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/CategoryQuery.php#L72-L84 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Cron/IndexLogEvent.php | IndexLogEvent.execute | public function execute()
{
$events = $this->eventQueue->getEvents($this->chunkSize);
if (!empty($events)) {
$this->eventIndex->indexEvents($events);
$this->sessionIndex->indexEvents($events);
$this->eventQueue->deleteEvents(array_column($events, 'event_id'));
... | php | public function execute()
{
$events = $this->eventQueue->getEvents($this->chunkSize);
if (!empty($events)) {
$this->eventIndex->indexEvents($events);
$this->sessionIndex->indexEvents($events);
$this->eventQueue->deleteEvents(array_column($events, 'event_id'));
... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"events",
"=",
"$",
"this",
"->",
"eventQueue",
"->",
"getEvents",
"(",
"$",
"this",
"->",
"chunkSize",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"events",
")",
")",
"{",
"$",
"this",
"->",
... | Run the indexation.
@return void | [
"Run",
"the",
"indexation",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Cron/IndexLogEvent.php#L71-L79 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Search/Request/Product/Attribute/Aggregation/Decimal.php | Decimal.getAggregationData | public function getAggregationData(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute)
{
return ['name' => $attribute->getAttributeCode(), 'type' => BucketInterface::TYPE_HISTOGRAM, 'minDocCount' => 1];
} | php | public function getAggregationData(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute)
{
return ['name' => $attribute->getAttributeCode(), 'type' => BucketInterface::TYPE_HISTOGRAM, 'minDocCount' => 1];
} | [
"public",
"function",
"getAggregationData",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"ResourceModel",
"\\",
"Eav",
"\\",
"Attribute",
"$",
"attribute",
")",
"{",
"return",
"[",
"'name'",
"=>",
"$",
"attribute",
"->",
"getAttributeCode",
"(",... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Attribute/Aggregation/Decimal.php#L31-L34 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Modifier/AjaxFilter.php | AjaxFilter.modifyAttributes | public function modifyAttributes($storeId, $requestName, $attributes, $query, $filters, $queryFilters)
{
$relevantAttributes = $attributes;
if ($this->getAttributeCode()) {
$attributeCode = $this->getAttributeCode();
$relevantAttributes = array_filter($attributes, function ($... | php | public function modifyAttributes($storeId, $requestName, $attributes, $query, $filters, $queryFilters)
{
$relevantAttributes = $attributes;
if ($this->getAttributeCode()) {
$attributeCode = $this->getAttributeCode();
$relevantAttributes = array_filter($attributes, function ($... | [
"public",
"function",
"modifyAttributes",
"(",
"$",
"storeId",
",",
"$",
"requestName",
",",
"$",
"attributes",
",",
"$",
"query",
",",
"$",
"filters",
",",
"$",
"queryFilters",
")",
"{",
"$",
"relevantAttributes",
"=",
"$",
"attributes",
";",
"if",
"(",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Modifier/AjaxFilter.php#L62-L73 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Modifier/AjaxFilter.php | AjaxFilter.modifyAggregations | public function modifyAggregations($storeId, $requestName, $aggregations, $query, $filters, $queryFilters)
{
if ($this->getAttributeCode()) {
$aggregationName = $this->getFilterField();
if ($aggregationName && isset($aggregations[$aggregationName])) {
$aggregations[$a... | php | public function modifyAggregations($storeId, $requestName, $aggregations, $query, $filters, $queryFilters)
{
if ($this->getAttributeCode()) {
$aggregationName = $this->getFilterField();
if ($aggregationName && isset($aggregations[$aggregationName])) {
$aggregations[$a... | [
"public",
"function",
"modifyAggregations",
"(",
"$",
"storeId",
",",
"$",
"requestName",
",",
"$",
"aggregations",
",",
"$",
"query",
",",
"$",
"filters",
",",
"$",
"queryFilters",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getAttributeCode",
"(",
")",
")... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Modifier/AjaxFilter.php#L78-L88 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Modifier/AjaxFilter.php | AjaxFilter.getAttributeCode | private function getAttributeCode()
{
$attributeCode = false;
if ($this->request->isAjax() && $this->request->getParam('filterName')) {
$attributeCode = (string) $this->request->getParam('filterName');
}
return $attributeCode;
} | php | private function getAttributeCode()
{
$attributeCode = false;
if ($this->request->isAjax() && $this->request->getParam('filterName')) {
$attributeCode = (string) $this->request->getParam('filterName');
}
return $attributeCode;
} | [
"private",
"function",
"getAttributeCode",
"(",
")",
"{",
"$",
"attributeCode",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"request",
"->",
"isAjax",
"(",
")",
"&&",
"$",
"this",
"->",
"request",
"->",
"getParam",
"(",
"'filterName'",
")",
")",
"... | Get attribute code
@return bool|string | [
"Get",
"attribute",
"code"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Modifier/AjaxFilter.php#L95-L104 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Modifier/AjaxFilter.php | AjaxFilter.getFilterField | private function getFilterField()
{
try {
$attribute = $this->getAttribute();
$field = $this->mappingHelper->getFilterField($attribute);
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
$field = $this->getAttributeCode();
}
... | php | private function getFilterField()
{
try {
$attribute = $this->getAttribute();
$field = $this->mappingHelper->getFilterField($attribute);
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
$field = $this->getAttributeCode();
}
... | [
"private",
"function",
"getFilterField",
"(",
")",
"{",
"try",
"{",
"$",
"attribute",
"=",
"$",
"this",
"->",
"getAttribute",
"(",
")",
";",
"$",
"field",
"=",
"$",
"this",
"->",
"mappingHelper",
"->",
"getFilterField",
"(",
"$",
"attribute",
")",
";",
... | Get filter field
@return bool|string | [
"Get",
"filter",
"field"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Modifier/AjaxFilter.php#L121-L131 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/Search/Request/Source/Containers.php | Containers.toOptionArray | public function toOptionArray()
{
$options = [];
foreach ($this->getContainers() as $container) {
$options[] = ['value' => $container['name'], 'label' => __($container['label'])];
}
return $options;
} | php | public function toOptionArray()
{
$options = [];
foreach ($this->getContainers() as $container) {
$options[] = ['value' => $container['name'], 'label' => __($container['label'])];
}
return $options;
} | [
"public",
"function",
"toOptionArray",
"(",
")",
"{",
"$",
"options",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getContainers",
"(",
")",
"as",
"$",
"container",
")",
"{",
"$",
"options",
"[",
"]",
"=",
"[",
"'value'",
"=>",
"$",
"con... | Return array of options as value-label pairs
@return array Format: array(array('value' => '<value>', 'label' => '<label>'), ...) | [
"Return",
"array",
"of",
"options",
"as",
"value",
"-",
"label",
"pairs"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/Request/Source/Containers.php#L48-L56 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/Identities.php | Identities.get | public function get()
{
$identities = [];
$origData = $this->optimizer->getOrigData();
$containers = $this->optimizer->getData('search_container') ?? [];
if (!$this->optimizer->isObjectNew()) {
$containers = array_unique(
array_keys(array_merge($this->o... | php | public function get()
{
$identities = [];
$origData = $this->optimizer->getOrigData();
$containers = $this->optimizer->getData('search_container') ?? [];
if (!$this->optimizer->isObjectNew()) {
$containers = array_unique(
array_keys(array_merge($this->o... | [
"public",
"function",
"get",
"(",
")",
"{",
"$",
"identities",
"=",
"[",
"]",
";",
"$",
"origData",
"=",
"$",
"this",
"->",
"optimizer",
"->",
"getOrigData",
"(",
")",
";",
"$",
"containers",
"=",
"$",
"this",
"->",
"optimizer",
"->",
"getData",
"(",... | Get Limitation identities for the current optimizer.
@return array | [
"Get",
"Limitation",
"identities",
"for",
"the",
"current",
"optimizer",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/Identities.php#L69-L90 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/Identities.php | Identities.getSearchQueryIdentities | private function getSearchQueryIdentities()
{
$identities = [];
$queryIds = [];
$origData = $this->optimizer->getOrigData();
$data = $this->optimizer->getData();
// If optimizer was previously assigned to all queries, or is now set to all queries.
$isApplie... | php | private function getSearchQueryIdentities()
{
$identities = [];
$queryIds = [];
$origData = $this->optimizer->getOrigData();
$data = $this->optimizer->getData();
// If optimizer was previously assigned to all queries, or is now set to all queries.
$isApplie... | [
"private",
"function",
"getSearchQueryIdentities",
"(",
")",
"{",
"$",
"identities",
"=",
"[",
"]",
";",
"$",
"queryIds",
"=",
"[",
"]",
";",
"$",
"origData",
"=",
"$",
"this",
"->",
"optimizer",
"->",
"getOrigData",
"(",
")",
";",
"$",
"data",
"=",
... | Get search queries identities related to current optimizer.
@return array | [
"Get",
"search",
"queries",
"identities",
"related",
"to",
"current",
"optimizer",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/Identities.php#L97-L136 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/Identities.php | Identities.getCategoryIdentities | private function getCategoryIdentities()
{
$identities = [];
$categoryIds = [];
$origData = $this->optimizer->getOrigData();
$data = $this->optimizer->getData();
// If optimizer was previously assigned to all categories, or is now set to all categories.
$i... | php | private function getCategoryIdentities()
{
$identities = [];
$categoryIds = [];
$origData = $this->optimizer->getOrigData();
$data = $this->optimizer->getData();
// If optimizer was previously assigned to all categories, or is now set to all categories.
$i... | [
"private",
"function",
"getCategoryIdentities",
"(",
")",
"{",
"$",
"identities",
"=",
"[",
"]",
";",
"$",
"categoryIds",
"=",
"[",
"]",
";",
"$",
"origData",
"=",
"$",
"this",
"->",
"optimizer",
"->",
"getOrigData",
"(",
")",
";",
"$",
"data",
"=",
... | Get category identities related to current optimizer.
@return array | [
"Get",
"category",
"identities",
"related",
"to",
"current",
"optimizer",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/Identities.php#L143-L178 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/Identities.php | Identities.getMaxCountCacheableSearchTerms | private function getMaxCountCacheableSearchTerms(int $storeId)
{
return $this->scopeConfig->getValue(
PopularSearchTerms::XML_PATH_MAX_COUNT_CACHEABLE_SEARCH_TERMS,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
$storeId
);
} | php | private function getMaxCountCacheableSearchTerms(int $storeId)
{
return $this->scopeConfig->getValue(
PopularSearchTerms::XML_PATH_MAX_COUNT_CACHEABLE_SEARCH_TERMS,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
$storeId
);
} | [
"private",
"function",
"getMaxCountCacheableSearchTerms",
"(",
"int",
"$",
"storeId",
")",
"{",
"return",
"$",
"this",
"->",
"scopeConfig",
"->",
"getValue",
"(",
"PopularSearchTerms",
"::",
"XML_PATH_MAX_COUNT_CACHEABLE_SEARCH_TERMS",
",",
"\\",
"Magento",
"\\",
"Sto... | Retrieve maximum count cacheable search terms by Store.
@param int $storeId Store Id
@return int | [
"Retrieve",
"maximum",
"count",
"cacheable",
"search",
"terms",
"by",
"Store",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/Identities.php#L187-L194 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Model/ResourceModel/EventQueue.php | EventQueue.saveEvent | public function saveEvent($eventData)
{
$serializedEvent = $this->jsonSerializer->serialize($eventData);
$insertData = ['event_id' => md5($serializedEvent . time()), 'data' => $serializedEvent];
$this->getConnection()->insertOnDuplicate($this->getMainTable(), $insertData, ['data']);
} | php | public function saveEvent($eventData)
{
$serializedEvent = $this->jsonSerializer->serialize($eventData);
$insertData = ['event_id' => md5($serializedEvent . time()), 'data' => $serializedEvent];
$this->getConnection()->insertOnDuplicate($this->getMainTable(), $insertData, ['data']);
} | [
"public",
"function",
"saveEvent",
"(",
"$",
"eventData",
")",
"{",
"$",
"serializedEvent",
"=",
"$",
"this",
"->",
"jsonSerializer",
"->",
"serialize",
"(",
"$",
"eventData",
")",
";",
"$",
"insertData",
"=",
"[",
"'event_id'",
"=>",
"md5",
"(",
"$",
"s... | Save an event to the queue.
@param array $eventData Event data.
@return void | [
"Save",
"an",
"event",
"to",
"the",
"queue",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/ResourceModel/EventQueue.php#L57-L62 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Model/ResourceModel/EventQueue.php | EventQueue.getEvents | public function getEvents($limit = null)
{
$select = $this->getConnection()->select()->from($this->getMainTable());
if ($limit !== null) {
$select->limit($limit);
}
$eventData = $this->getConnection()->fetchAll($select);
foreach ($eventData as &$currentEvent) {... | php | public function getEvents($limit = null)
{
$select = $this->getConnection()->select()->from($this->getMainTable());
if ($limit !== null) {
$select->limit($limit);
}
$eventData = $this->getConnection()->fetchAll($select);
foreach ($eventData as &$currentEvent) {... | [
"public",
"function",
"getEvents",
"(",
"$",
"limit",
"=",
"null",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"select",
"(",
")",
"->",
"from",
"(",
"$",
"this",
"->",
"getMainTable",
"(",
")",
")",
";",
"if",... | Get event from the queue.
@param integer $limit Max number of events to be retrieved.
@return array | [
"Get",
"event",
"from",
"the",
"queue",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/ResourceModel/EventQueue.php#L71-L87 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Model/ResourceModel/EventQueue.php | EventQueue.deleteEvents | public function deleteEvents(array $eventIds)
{
$connection = $this->getConnection();
$connection->delete($this->getMainTable(), $connection->quoteInto('event_id IN(?)', $eventIds));
} | php | public function deleteEvents(array $eventIds)
{
$connection = $this->getConnection();
$connection->delete($this->getMainTable(), $connection->quoteInto('event_id IN(?)', $eventIds));
} | [
"public",
"function",
"deleteEvents",
"(",
"array",
"$",
"eventIds",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"$",
"connection",
"->",
"delete",
"(",
"$",
"this",
"->",
"getMainTable",
"(",
")",
",",
"$",
"co... | Clean event from the reindex queue.
@param array $eventIds Event ids to be deleted.
@return void | [
"Clean",
"event",
"from",
"the",
"reindex",
"queue",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/ResourceModel/EventQueue.php#L96-L100 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php | Position.getByProductIds | public function getByProductIds(array $productIds, $storeId)
{
$searchQueryTable = $this->getTable('search_query');
$select = $this->getBaseSelect()
->joinInner($searchQueryTable, "main_table.query_id = {$searchQueryTable}.query_id", [])
->where('product_id IN(?)', $productId... | php | public function getByProductIds(array $productIds, $storeId)
{
$searchQueryTable = $this->getTable('search_query');
$select = $this->getBaseSelect()
->joinInner($searchQueryTable, "main_table.query_id = {$searchQueryTable}.query_id", [])
->where('product_id IN(?)', $productId... | [
"public",
"function",
"getByProductIds",
"(",
"array",
"$",
"productIds",
",",
"$",
"storeId",
")",
"{",
"$",
"searchQueryTable",
"=",
"$",
"this",
"->",
"getTable",
"(",
"'search_query'",
")",
";",
"$",
"select",
"=",
"$",
"this",
"->",
"getBaseSelect",
"... | Get query position for a product list.
@param array $productIds Product ids.
@param int $storeId Store ids.
@return array | [
"Get",
"query",
"position",
"for",
"a",
"product",
"list",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php#L62-L72 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php | Position.getProductPositionsByQuery | public function getProductPositionsByQuery($query)
{
if (is_object($query)) {
$query = $query->getId();
}
$select = $this->getBaseSelect()
->where('query_id = ?', (int) $query)
->where('position IS NOT NULL')
->columns(['product_id', 'position... | php | public function getProductPositionsByQuery($query)
{
if (is_object($query)) {
$query = $query->getId();
}
$select = $this->getBaseSelect()
->where('query_id = ?', (int) $query)
->where('position IS NOT NULL')
->columns(['product_id', 'position... | [
"public",
"function",
"getProductPositionsByQuery",
"(",
"$",
"query",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"query",
")",
")",
"{",
"$",
"query",
"=",
"$",
"query",
"->",
"getId",
"(",
")",
";",
"}",
"$",
"select",
"=",
"$",
"this",
"->",
"g... | Load product positions for the given query.
@param Query|int $query Query.
@return array | [
"Load",
"product",
"positions",
"for",
"the",
"given",
"query",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php#L81-L94 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php | Position.getProductBlacklistByQuery | public function getProductBlacklistByQuery($query)
{
if (is_object($query)) {
$query = $query->getId();
}
$select = $this->getBaseSelect()
->columns(['product_id'])
->where('query_id = ?', (int) $query)
->where('is_blacklisted = ?', (int) true... | php | public function getProductBlacklistByQuery($query)
{
if (is_object($query)) {
$query = $query->getId();
}
$select = $this->getBaseSelect()
->columns(['product_id'])
->where('query_id = ?', (int) $query)
->where('is_blacklisted = ?', (int) true... | [
"public",
"function",
"getProductBlacklistByQuery",
"(",
"$",
"query",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"query",
")",
")",
"{",
"$",
"query",
"=",
"$",
"query",
"->",
"getId",
"(",
")",
";",
"}",
"$",
"select",
"=",
"$",
"this",
"->",
"g... | Load blacklisted products for the given query.
@param Query|int $query Query.
@return array | [
"Load",
"blacklisted",
"products",
"for",
"the",
"given",
"query",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php#L103-L115 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php | Position.saveProductPositions | public function saveProductPositions($queryId, $newProductPositions, $blacklistedProducts = [])
{
$reindexedProductIds = array_merge(
array_keys($newProductPositions),
array_keys($this->getProductPositionsByQuery($queryId)),
$blacklistedProducts
);
$delet... | php | public function saveProductPositions($queryId, $newProductPositions, $blacklistedProducts = [])
{
$reindexedProductIds = array_merge(
array_keys($newProductPositions),
array_keys($this->getProductPositionsByQuery($queryId)),
$blacklistedProducts
);
$delet... | [
"public",
"function",
"saveProductPositions",
"(",
"$",
"queryId",
",",
"$",
"newProductPositions",
",",
"$",
"blacklistedProducts",
"=",
"[",
"]",
")",
"{",
"$",
"reindexedProductIds",
"=",
"array_merge",
"(",
"array_keys",
"(",
"$",
"newProductPositions",
")",
... | Save the product positions.
@param int $queryId Query id.
@param array $newProductPositions Product positions.
@param array $blacklistedProducts Blacklisted product ids.
@return \Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Search\Position | [
"Save",
"the",
"product",
"positions",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php#L126-L159 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php | Position.reindex | private function reindex($productIds)
{
$this->indexerRegistry->get(\Magento\CatalogSearch\Model\Indexer\Fulltext::INDEXER_ID)->reindexList($productIds);
} | php | private function reindex($productIds)
{
$this->indexerRegistry->get(\Magento\CatalogSearch\Model\Indexer\Fulltext::INDEXER_ID)->reindexList($productIds);
} | [
"private",
"function",
"reindex",
"(",
"$",
"productIds",
")",
"{",
"$",
"this",
"->",
"indexerRegistry",
"->",
"get",
"(",
"\\",
"Magento",
"\\",
"CatalogSearch",
"\\",
"Model",
"\\",
"Indexer",
"\\",
"Fulltext",
"::",
"INDEXER_ID",
")",
"->",
"reindexList"... | Reindex product on position change.
@param array $productIds Product ids to be reindexed.
@return void | [
"Reindex",
"product",
"on",
"position",
"change",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Search/Position.php#L177-L180 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Controller/Adminhtml/Thesaurus/Create.php | Create.execute | public function execute()
{
$resultPage = $this->createPage();
if ($this->getRequest()->getParam("type")) {
$this->_forward('edit');
return $resultPage;
}
$resultPage->getConfig()->getTitle()->prepend(__('Create Thesaurus'));
$resultPage->addBreadcr... | php | public function execute()
{
$resultPage = $this->createPage();
if ($this->getRequest()->getParam("type")) {
$this->_forward('edit');
return $resultPage;
}
$resultPage->getConfig()->getTitle()->prepend(__('Create Thesaurus'));
$resultPage->addBreadcr... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"resultPage",
"=",
"$",
"this",
"->",
"createPage",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",
"\"type\"",
")",
")",
"{",
"$",
"this",
"->",
"_for... | Render Thesaurus creation screen
@return \Magento\Backend\Model\View\Result\Page | [
"Render",
"Thesaurus",
"creation",
"screen"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Controller/Adminhtml/Thesaurus/Create.php#L32-L46 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Autocomplete/AttributeList.php | AttributeList.getList | public function getList()
{
/** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection */
$collection = $this->collectionFactory->create();
$collection->setItemObjectClass(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class)
->setOrder('position'... | php | public function getList()
{
/** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection */
$collection = $this->collectionFactory->create();
$collection->setItemObjectClass(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class)
->setOrder('position'... | [
"public",
"function",
"getList",
"(",
")",
"{",
"/** @var $collection \\Magento\\Catalog\\Model\\ResourceModel\\Product\\Attribute\\Collection */",
"$",
"collection",
"=",
"$",
"this",
"->",
"collectionFactory",
"->",
"create",
"(",
")",
";",
"$",
"collection",
"->",
"set... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Aggregation/Provider/FilterableAttributes/Autocomplete/AttributeList.php#L46-L60 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/CatalogSearch/Result/Cache.php | Cache.isPageCacheable | public function isPageCacheable()
{
$result = false;
$pragma = $this->response->getHeader('pragma');
if ($pragma) {
$result = $pragma->getFieldValue() === 'cache';
}
return $result;
} | php | public function isPageCacheable()
{
$result = false;
$pragma = $this->response->getHeader('pragma');
if ($pragma) {
$result = $pragma->getFieldValue() === 'cache';
}
return $result;
} | [
"public",
"function",
"isPageCacheable",
"(",
")",
"{",
"$",
"result",
"=",
"false",
";",
"$",
"pragma",
"=",
"$",
"this",
"->",
"response",
"->",
"getHeader",
"(",
"'pragma'",
")",
";",
"if",
"(",
"$",
"pragma",
")",
"{",
"$",
"result",
"=",
"$",
... | Check if current page is cacheable
@return bool | [
"Check",
"if",
"current",
"page",
"is",
"cacheable"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/CatalogSearch/Result/Cache.php#L73-L83 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Navigation/FilterRenderer.php | FilterRenderer._toHtml | public function _toHtml()
{
$html = '';
foreach ($this->getChildNames() as $childName) {
if ($html === '') {
$renderer = $this->getChildBlock($childName);
$html = $renderer->render($this->getFilter());
}
}
return $html;
} | php | public function _toHtml()
{
$html = '';
foreach ($this->getChildNames() as $childName) {
if ($html === '') {
$renderer = $this->getChildBlock($childName);
$html = $renderer->render($this->getFilter());
}
}
return $html;
} | [
"public",
"function",
"_toHtml",
"(",
")",
"{",
"$",
"html",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"getChildNames",
"(",
")",
"as",
"$",
"childName",
")",
"{",
"if",
"(",
"$",
"html",
"===",
"''",
")",
"{",
"$",
"renderer",
"=",
"$",... | @SuppressWarnings(PHPMD.CamelCaseMethodName)
{@inheritDoc} | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"CamelCaseMethodName",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/FilterRenderer.php#L45-L57 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/Search/Usage/Kpi/ConversionRates/Report.php | Report.processResponse | protected function processResponse(\Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\QueryResponse $response)
{
$data = [];
foreach ($this->getBucketValues($response) as $value) {
$sessionType = $value->getValue();
if ($sessionType == 'all') {
$ses... | php | protected function processResponse(\Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\QueryResponse $response)
{
$data = [];
foreach ($this->getBucketValues($response) as $value) {
$sessionType = $value->getValue();
if ($sessionType == 'all') {
$ses... | [
"protected",
"function",
"processResponse",
"(",
"\\",
"Smile",
"\\",
"ElasticsuiteCore",
"\\",
"Search",
"\\",
"Adapter",
"\\",
"Elasticsuite",
"\\",
"Response",
"\\",
"QueryResponse",
"$",
"response",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"... | {@inheritdoc}
@SuppressWarnings(PHPMD.ElseExpression) | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Search/Usage/Kpi/ConversionRates/Report.php#L31-L52 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/Nested.php | Nested.buildQuery | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_NESTED) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$queryParams = [
'path' => $query->getPath(),
... | php | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_NESTED) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$queryParams = [
'path' => $query->getPath(),
... | [
"public",
"function",
"buildQuery",
"(",
"QueryInterface",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"->",
"getType",
"(",
")",
"!==",
"QueryInterface",
"::",
"TYPE_NESTED",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Query build... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/Nested.php#L32-L50 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Analysis/Config/Converter.php | Converter.convert | public function convert($source)
{
$xpath = new \DOMXPath($source);
$defaultConfig = $this->getDefaultConfiguration($xpath);
$configuration = ['default' => $defaultConfig];
foreach ($this->getAllLanguages($xpath) as $language) {
$configuration[$language] = $this->getLan... | php | public function convert($source)
{
$xpath = new \DOMXPath($source);
$defaultConfig = $this->getDefaultConfiguration($xpath);
$configuration = ['default' => $defaultConfig];
foreach ($this->getAllLanguages($xpath) as $language) {
$configuration[$language] = $this->getLan... | [
"public",
"function",
"convert",
"(",
"$",
"source",
")",
"{",
"$",
"xpath",
"=",
"new",
"\\",
"DOMXPath",
"(",
"$",
"source",
")",
";",
"$",
"defaultConfig",
"=",
"$",
"this",
"->",
"getDefaultConfiguration",
"(",
"$",
"xpath",
")",
";",
"$",
"configu... | Convert dom node tree to array.
@param mixed $source Configuration XML source.
@return array | [
"Convert",
"dom",
"node",
"tree",
"to",
"array",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Analysis/Config/Converter.php#L58-L70 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Analysis/Config/Converter.php | Converter.getDefaultConfiguration | private function getDefaultConfiguration(\DOMXPath $xpath)
{
$charFilters = $this->parseFilters($xpath, self::CHAR_FILTER_TYPE_ROOT_NODE, self::CHAR_FILTER_TYPE_NODE);
$filters = $this->parseFilters($xpath, self::FILTER_TYPE_ROOT_NODE, self::FILTER_TYPE_NODE);
$analyzers = $this->parse... | php | private function getDefaultConfiguration(\DOMXPath $xpath)
{
$charFilters = $this->parseFilters($xpath, self::CHAR_FILTER_TYPE_ROOT_NODE, self::CHAR_FILTER_TYPE_NODE);
$filters = $this->parseFilters($xpath, self::FILTER_TYPE_ROOT_NODE, self::FILTER_TYPE_NODE);
$analyzers = $this->parse... | [
"private",
"function",
"getDefaultConfiguration",
"(",
"\\",
"DOMXPath",
"$",
"xpath",
")",
"{",
"$",
"charFilters",
"=",
"$",
"this",
"->",
"parseFilters",
"(",
"$",
"xpath",
",",
"self",
"::",
"CHAR_FILTER_TYPE_ROOT_NODE",
",",
"self",
"::",
"CHAR_FILTER_TYPE_... | Return default configuration available for all languages.
@param \DOMXPath $xpath XPath access to the document parsed.
@return array | [
"Return",
"default",
"configuration",
"available",
"for",
"all",
"languages",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Analysis/Config/Converter.php#L79-L92 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Analysis/Config/Converter.php | Converter.getLanguageConfiguration | private function getLanguageConfiguration(\DOMXPath $xpath, $language, array $defaultConfig)
{
$languageCharFilters = $this->parseFilters(
$xpath,
self::CHAR_FILTER_TYPE_ROOT_NODE,
self::CHAR_FILTER_TYPE_NODE,
$language
);
$charFilters = array_... | php | private function getLanguageConfiguration(\DOMXPath $xpath, $language, array $defaultConfig)
{
$languageCharFilters = $this->parseFilters(
$xpath,
self::CHAR_FILTER_TYPE_ROOT_NODE,
self::CHAR_FILTER_TYPE_NODE,
$language
);
$charFilters = array_... | [
"private",
"function",
"getLanguageConfiguration",
"(",
"\\",
"DOMXPath",
"$",
"xpath",
",",
"$",
"language",
",",
"array",
"$",
"defaultConfig",
")",
"{",
"$",
"languageCharFilters",
"=",
"$",
"this",
"->",
"parseFilters",
"(",
"$",
"xpath",
",",
"self",
":... | Return configuration for a given language.
@param \DOMXPath $xpath XPath access to the document parsed.
@param string $language Current language.
@param array $defaultConfig Default configuration available for all languages.
@return array | [
"Return",
"configuration",
"for",
"a",
"given",
"language",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Analysis/Config/Converter.php#L103-L130 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Analysis/Config/Converter.php | Converter.getAllLanguages | private function getAllLanguages(\DOMXPath $xpath)
{
$languages = [];
foreach ($xpath->query('//*[@language]') as $currentNode) {
$languages[] = $currentNode->getAttribute('language');
}
return array_unique($languages);
} | php | private function getAllLanguages(\DOMXPath $xpath)
{
$languages = [];
foreach ($xpath->query('//*[@language]') as $currentNode) {
$languages[] = $currentNode->getAttribute('language');
}
return array_unique($languages);
} | [
"private",
"function",
"getAllLanguages",
"(",
"\\",
"DOMXPath",
"$",
"xpath",
")",
"{",
"$",
"languages",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"xpath",
"->",
"query",
"(",
"'//*[@language]'",
")",
"as",
"$",
"currentNode",
")",
"{",
"$",
"languages"... | Parse languages available in the document.
@param \DOMXPath $xpath XPath access to the document parsed.
@return array | [
"Parse",
"languages",
"available",
"in",
"the",
"document",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Analysis/Config/Converter.php#L139-L148 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Analysis/Config/Converter.php | Converter.parseFilters | private function parseFilters(\DOMXPath $xpath, $rootNodeName, $nodeName, $language = 'default')
{
$filters = [];
$languagePath = sprintf("[@language='%s']", $language);
$searchPath = sprintf("/%s/%s/%s%s", self::ROOT_NODE_NAME, $rootNodeName, $nodeName, $languagePath);
$filterNode... | php | private function parseFilters(\DOMXPath $xpath, $rootNodeName, $nodeName, $language = 'default')
{
$filters = [];
$languagePath = sprintf("[@language='%s']", $language);
$searchPath = sprintf("/%s/%s/%s%s", self::ROOT_NODE_NAME, $rootNodeName, $nodeName, $languagePath);
$filterNode... | [
"private",
"function",
"parseFilters",
"(",
"\\",
"DOMXPath",
"$",
"xpath",
",",
"$",
"rootNodeName",
",",
"$",
"nodeName",
",",
"$",
"language",
"=",
"'default'",
")",
"{",
"$",
"filters",
"=",
"[",
"]",
";",
"$",
"languagePath",
"=",
"sprintf",
"(",
... | Filters parser by language.
@param \DOMXPath $xpath XPath access to the document parsed.
@param string $rootNodeName Parsing root node.
@param string $nodeName Name of the nodes look up.
@param string $language Language searched.
@return array | [
"Filters",
"parser",
"by",
"language",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Analysis/Config/Converter.php#L160-L182 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.