51 $this->_eavEntityAttribute = $eavEntityAttribute;
52 parent::__construct(
$data);
93 self::VISIBILITY_NOT_VISIBLE =>
__(
'Not Visible Individually'),
94 self::VISIBILITY_IN_CATALOG =>
__(
'Catalog'),
95 self::VISIBILITY_IN_SEARCH =>
__(
'Search'),
96 self::VISIBILITY_BOTH =>
__(
'Catalog, Search')
108 array_unshift(
$options, [
'value' =>
'',
'label' =>
'']);
152 'type' => Table::TYPE_SMALLINT,
154 'comment' =>
'Catalog Product Visibility ' .
$attributeCode .
' column',
177 return $this->_eavEntityAttribute->getFlatUpdateSelect($this->
getAttribute(),
$store);
213 $attributeTable = $this->
getAttribute()->getBackend()->getTable();
214 $linkField = $this->
getAttribute()->getEntity()->getLinkField();
220 "e.{$linkField}={$tableName}.{$linkField}" .
221 " AND {$tableName}.attribute_id='{$attributeId}'" .
222 " AND {$tableName}.store_id='0'",
230 [$valueTable1 => $attributeTable],
231 "e.{$linkField}={$valueTable1}.{$linkField}" .
232 " AND {$valueTable1}.attribute_id='{$attributeId}'" .
233 " AND {$valueTable1}.store_id='0'",
236 [$valueTable2 => $attributeTable],
237 "e.{$linkField}={$valueTable2}.{$linkField}" .
238 " AND {$valueTable2}.attribute_id='{$attributeId}'" .
239 " AND {$valueTable2}.store_id='{$collection->getStoreId()}'",
242 $valueExpr =
$collection->getConnection()->getCheckSql(
243 $valueTable2 .
'.value_id > 0',
244 $valueTable2 .
'.value',
245 $valueTable1 .
'.value' 249 $collection->getSelect()->order($valueExpr .
' ' . $dir);
__construct(\Magento\Eav\Model\ResourceModel\Entity\Attribute $eavEntityAttribute, array $data=[])
static getOptionText($optionId)
addValueSortToCollection($collection, $dir='asc')
const VISIBILITY_IN_SEARCH
const VISIBILITY_IN_CATALOG
getFlatUpdateSelect($store)
const VISIBILITY_NOT_VISIBLE