Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Retrieve flat column definition
- *
- * @return array
- */
- public function getFlatColums()
- {
- $attributeCode = $this->getAttribute()->getAttributeCode();
- $column = array(
- 'unsigned' => false,
- 'default' => null,
- 'extra' => null
- );
- if (Mage::helper('core')->useDbCompatibleMode()) {
- $column['type'] = 'tinyint(1)';
- $column['is_null'] = true;
- } else {
- $column['type'] = Varien_Db_Ddl_Table::TYPE_SMALLINT;
- $column['length'] = 1;
- $column['nullable'] = true;
- $column['comment'] = $attributeCode . ' column';
- }
- return array($attributeCode => $column);
- }
- /**
- * Retrieve Indexes(s) for Flat
- *
- * @return array
- */
- public function getFlatIndexes()
- {
- $indexes = array();
- $index = 'IDX_' . strtoupper($this->getAttribute()->getAttributeCode());
- $indexes[$index] = array(
- 'type' => 'index',
- 'fields' => array($this->getAttribute()->getAttributeCode())
- );
- return $indexes;
- }
- /**
- * Retrieve Select For Flat Attribute update
- *
- * @param int $store
- * @return Varien_Db_Select|null
- */
- public function getFlatUpdateSelect($store)
- {
- return Mage::getResourceModel('eav/entity_attribute')
- ->getFlatUpdateSelect($this->getAttribute(), $store);
- }
- /**
- * Get a text for index option value
- *
- * @param string|int $value
- * @return string|bool
- */
- public function getIndexOptionText($value)
- {
- switch ($value) {
- case self::VALUE_YES:
- return 'Yes';
- case self::VALUE_NO:
- return 'No';
- }
- return parent::getIndexOptionText($value);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement