Mage_Core_Model_Flag Class Reference

Inheritance diagram for Mage_Core_Model_Flag:

Mage_Core_Model_Abstract Varien_Object Mage_Catalog_Model_Product_Flat_Flag Mage_CatalogIndex_Model_Catalog_Index_Flag Mage_CatalogIndex_Model_Catalog_Index_Kill_Flag

List of all members.

Public Member Functions

 getFlagData ()
 setFlagData ($value)
 loadSelf ()

Protected Member Functions

 _construct ()
 _beforeSave ()

Protected Attributes

 $_flagCode = null


Detailed Description

Definition at line 35 of file Flag.php.


Member Function Documentation

_beforeSave (  )  [protected]

Processing object before save data

Returns:
Mage_Core_Model_Flag

Reimplemented from Mage_Core_Model_Abstract.

Reimplemented in Mage_CatalogIndex_Model_Catalog_Index_Flag.

Definition at line 58 of file Flag.php.

00059     {
00060         if (is_null($this->_flagCode)) {
00061             Mage::throwException(Mage::helper('core')->__('Please define flag code.'));
00062         }
00063 
00064         $this->setFlagCode($this->_flagCode);
00065         $this->setLastUpdate(date('Y-m-d H:i:s'));
00066 
00067         return parent::_beforeSave();
00068     }

_construct (  )  [protected]

Init resource model

Reimplemented from Varien_Object.

Definition at line 48 of file Flag.php.

00049     {
00050         $this->_init('core/flag');
00051     }

getFlagData (  ) 

Retrieve flag data

Returns:
mixed

Reimplemented in Mage_Catalog_Model_Product_Flat_Flag.

Definition at line 75 of file Flag.php.

00076     {
00077         if ($this->hasFlagData()) {
00078             return unserialize($this->getData('flag_data'));
00079         } else {
00080             return null;
00081         }
00082     }

loadSelf (  ) 

load self (load by flag code)

Returns:
Mage_Core_Model_Flag

Definition at line 100 of file Flag.php.

00101     {
00102         if (is_null($this->_flagCode)) {
00103             Mage::throwException(Mage::helper('core')->__('Please define flag code.'));
00104         }
00105 
00106         return $this->load($this->_flagCode, 'flag_code');
00107     }

setFlagData ( value  ) 

Set flag data

Parameters:
mixed $value
Returns:
Mage_Core_Model_Flag

Definition at line 90 of file Flag.php.

00091     {
00092         return $this->setData('flag_data', serialize($value));
00093     }


Member Data Documentation

$_flagCode = null [protected]


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

Generated on Sat Jul 4 17:23:57 2009 for Magento by  doxygen 1.5.8