6 declare(strict_types=1);
27 private $resourceConnection;
37 private $storeManager;
42 private $metadataPool;
59 $this->metadataPool = $metadataPool;
69 $storeId = $this->storeManager->getStore()->getId();
70 $connection = $this->resourceConnection->getConnection();
71 $valueCondition =
'at_name.value';
72 $tableName = $this->resourceConnection->getTableName(
'catalog_product_entity_varchar');
81 'at_name.value_id > 0',
83 'at_name_default.value' 89 $this->getConditionByAliasAndStoreId((
int)
$storeId,
'at_name'),
90 [
'name' => $valueCondition]
100 private function getConditionByAliasAndStoreId(
int $storeId,
string $alias): string
102 $metadata = $this->metadataPool->getMetadata(ProductInterface::class);
103 $linkField = $metadata->getLinkField();
105 $connection = $this->resourceConnection->getConnection();
109 $alias .
'.' . $linkField .
' = product.' . $linkField,