12 class Boolean extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
33 $this->_eavAttrEntity = $eavAttrEntity;
43 if ($this->_options ===
null) {
115 $indexes[
$index] = [
'type' =>
'index',
'fields' => [$this->
getAttribute()->getAttributeCode()]];
128 return $this->_eavAttrEntity->create()->getFlatUpdateSelect($this->
getAttribute(),
$store);
146 return parent::getIndexOptionText(
$value);
161 $attributeTable = $this->
getAttribute()->getBackend()->getTable();
162 $linkField = $this->
getAttribute()->getEntity()->getLinkField();
169 "e.{$linkField}={$tableName}.{$linkField}" 170 .
" AND {$tableName}.attribute_id='{$attributeId}'" 171 .
" AND {$tableName}.store_id='0'",
180 [$valueTable1 => $attributeTable],
181 "e.{$linkField}={$valueTable1}.{$linkField}" 182 .
" AND {$valueTable1}.attribute_id='{$attributeId}'" 183 .
" AND {$valueTable1}.store_id='0'",
187 [$valueTable2 => $attributeTable],
188 "e.{$linkField}={$valueTable2}.{$linkField}" 189 .
" AND {$valueTable2}.attribute_id='{$attributeId}'" 190 .
" AND {$valueTable2}.store_id='{$collection->getStoreId()}'",
193 $valueExpr =
$collection->getConnection()->getCheckSql(
194 $valueTable2 .
'.value_id > 0',
195 $valueTable2 .
'.value',
196 $valueTable1 .
'.value' 200 $collection->getSelect()->order($valueExpr .
' ' . $dir);
getFlatUpdateSelect($store)
__construct(\Magento\Eav\Model\ResourceModel\Entity\AttributeFactory $eavAttrEntity)
addValueSortToCollection($collection, $dir=\Magento\Framework\DB\Select::SQL_ASC)
getIndexOptionText($value)