Mage_Eav_Model_Entity_Attribute_Source_Abstract Class Reference

Inheritance diagram for Mage_Eav_Model_Entity_Attribute_Source_Abstract:

Mage_Eav_Model_Entity_Attribute_Source_Interface Mage_Bundle_Model_Product_Attribute_Source_Price_View Mage_Catalog_Model_Category_Attribute_Source_Layout Mage_Catalog_Model_Category_Attribute_Source_Mode Mage_Catalog_Model_Category_Attribute_Source_Page Mage_Catalog_Model_Category_Attribute_Source_Sortby Mage_Catalog_Model_Product_Attribute_Source_Layout Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Attribute_Source_Layout Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Attribute_Source_Mode Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Attribute_Source_Page Mage_Core_Model_Design_Source_Apply Mage_Core_Model_Design_Source_Design Mage_Eav_Model_Entity_Attribute_Source_Boolean Mage_Eav_Model_Entity_Attribute_Source_Config Mage_Eav_Model_Entity_Attribute_Source_Table Mage_Tax_Model_Class_Source_Customer Mage_Tax_Model_Class_Source_Product

List of all members.

Public Member Functions

 setAttribute ($attribute)
 getAttribute ()
 getOptionText ($value)
 getOptionId ($value)
 addValueSortToCollection ($collection, $dir= 'asc')
 getFlatColums ()
 getFlatIndexes ()
 getFlatUpdateSelect ($store)

Protected Attributes

 $_attribute
 $_options


Detailed Description

Definition at line 35 of file Abstract.php.


Member Function Documentation

addValueSortToCollection ( collection,
dir = 'asc' 
)

Add Value Sort To Collection Select

Parameters:
Mage_Eav_Model_Entity_Collection_Abstract $collection
string $dir direction
Returns:
Mage_Eav_Model_Entity_Attribute_Source_Abstract

Reimplemented in Mage_Eav_Model_Entity_Attribute_Source_Table.

Definition at line 111 of file Abstract.php.

00111                                                                         {
00112         return $this;
00113     }

getAttribute (  ) 

Get attribute instance

Returns:
Mage_Eav_Model_Entity_Attribute_Abstract

Definition at line 68 of file Abstract.php.

00069     {
00070         return $this->_attribute;
00071     }

getFlatColums (  ) 

Retrieve Column(s) for Flat

Returns:
array

Reimplemented in Mage_Bundle_Model_Product_Attribute_Source_Price_View, Mage_Eav_Model_Entity_Attribute_Source_Boolean, Mage_Eav_Model_Entity_Attribute_Source_Table, and Mage_Tax_Model_Class_Source_Product.

Definition at line 120 of file Abstract.php.

00121     {
00122         return array();
00123     }

getFlatIndexes (  ) 

Retrieve Indexes(s) for Flat

Returns:
array

Reimplemented in Mage_Eav_Model_Entity_Attribute_Source_Boolean, and Mage_Eav_Model_Entity_Attribute_Source_Table.

Definition at line 130 of file Abstract.php.

00131     {
00132         return array();
00133     }

getFlatUpdateSelect ( store  ) 

Retrieve Select For Flat Attribute update

Parameters:
int $store
Returns:
Varien_Db_Select|null

Reimplemented in Mage_Bundle_Model_Product_Attribute_Source_Price_View, Mage_Eav_Model_Entity_Attribute_Source_Boolean, Mage_Eav_Model_Entity_Attribute_Source_Table, and Mage_Tax_Model_Class_Source_Product.

Definition at line 141 of file Abstract.php.

00142     {
00143         return null;
00144     }

getOptionId ( value  ) 

Definition at line 94 of file Abstract.php.

00095     {
00096         foreach ($this->getAllOptions() as $option) {
00097             if (strcasecmp($option['label'], $value)==0 || $option['value'] == $value) {
00098                 return $option['value'];
00099             }
00100         }
00101         return null;
00102     }

getOptionText ( value  ) 

Get a text for option value

Parameters:
string|integer $value
Returns:
string

Implements Mage_Eav_Model_Entity_Attribute_Source_Interface.

Reimplemented in Mage_Bundle_Model_Product_Attribute_Source_Price_View, Mage_Catalog_Model_Entity_Product_Attribute_Design_Options_Container, Mage_Core_Model_Design_Source_Design, Mage_Customer_Model_Customer_Attribute_Source_Store, Mage_Customer_Model_Customer_Attribute_Source_Website, Mage_Eav_Model_Entity_Attribute_Source_Boolean, Mage_Eav_Model_Entity_Attribute_Source_Table, and Mage_Tax_Model_Class_Source_Product.

Definition at line 79 of file Abstract.php.

00080     {
00081         $options = $this->getAllOptions();
00082         // Fixed for tax_class_id and custom_design
00083         if (sizeof($options) > 0) foreach($options as $option) {
00084             if (isset($option['value']) && $option['value'] == $value) {
00085                 return $option;
00086             }
00087         } // End
00088         if (isset($options[$value])) {
00089             return $options[$value];
00090         }
00091         return false;
00092     }

setAttribute ( attribute  ) 

Set attribute instance

Parameters:
Mage_Eav_Model_Entity_Attribute_Abstract $attribute
Returns:
Mage_Eav_Model_Entity_Attribute_Frontend_Abstract

Definition at line 57 of file Abstract.php.

00058     {
00059         $this->_attribute = $attribute;
00060         return $this;
00061     }


Member Data Documentation

$_attribute [protected]

Definition at line 42 of file Abstract.php.

$_options [protected]

Definition at line 49 of file Abstract.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:10 2009 for Magento by  doxygen 1.5.8