Mage_Core_Block_Template_Facade Class Reference

Inheritance diagram for Mage_Core_Block_Template_Facade:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 setDataByKey ($key, $value)
 setDataByKeyFromRegistry ($key, $registryKey)
 ifEquals ($conditionKeys)


Detailed Description

Definition at line 35 of file Facade.php.


Member Function Documentation

ifEquals ( conditionKeys  ) 

Check if data values by specified keys are equal $conditionKeys can be array or arbitrary set of params (func_get_args())

Parameters:
array $conditionKeys
Returns:
bool

Definition at line 74 of file Facade.php.

00075     {
00076         if (!is_array($conditionKeys)) {
00077             $conditionKeys = func_get_args();
00078         }
00079 
00080         // evaluate conditions (equality)
00081         if (!empty($conditionKeys)) {
00082             foreach ($conditionKeys as $key) {
00083                 if (!isset($this->_data[$key])) {
00084                     return false;
00085                 }
00086             }
00087             $lastValue = $this->_data[$key];
00088             foreach ($conditionKeys as $key) {
00089                 if ($this->_data[$key] !== $lastValue)  {
00090                     return false;
00091                 }
00092             }
00093         }
00094         return true;
00095     }

setDataByKey ( key,
value 
)

Just set data, like Varien_Object

This method is to be used in layout. In layout it can be understood better, than setSomeKeyBlahBlah()

Parameters:
string $key
string $value

Definition at line 46 of file Facade.php.

00047     {
00048         $this->_data[$key] = $value;
00049     }

setDataByKeyFromRegistry ( key,
registryKey 
)

Also set data, but take the value from registry by registry key

Parameters:
string $key
string $registryKey

Definition at line 57 of file Facade.php.

00058     {
00059         $registryItem = Mage::registry($registryKey);
00060         if (empty($registryItem)) {
00061             return;
00062         }
00063         $value = $registryItem->getData($key);
00064         $this->setDataByKey($key, $value);
00065     }


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

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