23 private $attributeResource;
30 private $attributeOptionProvider;
38 $this->attributeResource = $attributeResource;
39 $this->attributeOptionProvider = $attributeOptionProvider;
47 $select = $this->attributeResource->getConnection()->select()->from(
48 [
'super_attribute' => $this->attributeResource->getTable(
'catalog_product_super_attribute')],
50 'sku' =>
'entity.sku',
51 'product_id' =>
'product_entity.entity_id',
52 'attribute_code' =>
'attribute.attribute_code',
53 'value_index' =>
'entity_value.value',
54 'super_attribute_label' =>
'attribute_label.value',
57 [
'product_entity' => $this->attributeResource->getTable(
'catalog_product_entity')],
58 "product_entity.{$this->attributeOptionProvider->getProductEntityLinkField()} = super_attribute.product_id",
61 [
'product_link' => $this->attributeResource->getTable(
'catalog_product_super_link')],
62 'product_link.parent_id = super_attribute.product_id',
65 [
'attribute' => $this->attributeResource->getTable(
'eav_attribute')],
66 'attribute.attribute_id = super_attribute.attribute_id',
69 [
'entity' => $this->attributeResource->getTable(
'catalog_product_entity')],
70 'entity.entity_id = product_link.product_id',
77 'entity_value.attribute_id = super_attribute.attribute_id',
78 'entity_value.store_id = 0',
79 "entity_value.{$this->attributeOptionProvider->getProductEntityLinkField()} = " 80 .
"entity.{$this->attributeOptionProvider->getProductEntityLinkField()}",
85 [
'attribute_label' => $this->attributeResource->getTable(
'catalog_product_super_attribute_label')],
89 'super_attribute.product_super_attribute_id = attribute_label.product_super_attribute_id',
95 [
'attribute_option' => $this->attributeResource->getTable(
'eav_attribute_option')],
96 'attribute_option.option_id = entity_value.value',
99 'attribute_option.sort_order ASC' 101 'super_attribute.product_id = ?',
104 'attribute.attribute_id = ?',
111 'option_title' => $this->attributeResource->getConnection()->getIfNullSql(
112 'option_value.value',
113 'default_option_value.value' 115 'default_title' =>
'default_option_value.value',
118 [
'option_value' => $this->attributeResource->getTable(
'eav_attribute_option_value')],
122 'option_value.option_id = entity_value.value',
123 'option_value.store_id = ' . $scope->
getId(),
128 [
'default_option_value' => $this->attributeResource->getTable(
'eav_attribute_option_value')],
132 'default_option_value.option_id = entity_value.value',
getSelect(AbstractAttribute $superAttribute, int $productId, ScopeInterface $scope)
__construct(Attribute $attributeResource, OptionProvider $attributeOptionProvider)