Mage_Customer_Block_Address_Renderer_Default Class Reference

Inheritance diagram for Mage_Customer_Block_Address_Renderer_Default:

Mage_Core_Block_Abstract Mage_Customer_Block_Address_Renderer_Interface Varien_Object

List of all members.

Public Member Functions

 getType ()
 setType (Varien_Object $type)
 getFormat (Mage_Customer_Model_Address_Abstract $address=null)
 render (Mage_Customer_Model_Address_Abstract $address, $format=null)

Protected Attributes

 $_type


Detailed Description

Definition at line 35 of file Default.php.


Member Function Documentation

getFormat ( Mage_Customer_Model_Address_Abstract address = null  ) 

Definition at line 66 of file Default.php.

00067     {
00068         $countryFormat = is_null($address) ? false : $address->getCountryModel()->getFormat($this->getType()->getCode());
00069         $format = $countryFormat ? $countryFormat->getFormat() : $this->getType()->getDefaultFormat();
00070         return $format;
00071     }

getType (  ) 

Retrive format type object

Returns:
Varien_Object

Implements Mage_Customer_Block_Address_Renderer_Interface.

Definition at line 49 of file Default.php.

00050     {
00051         return $this->_type;
00052     }

render ( Mage_Customer_Model_Address_Abstract address,
format = null 
)

Render address

Parameters:
Mage_Customer_Model_Address_Abstract $address
Returns:
string

Definition at line 79 of file Default.php.

00080     {
00081         $address->getRegion();
00082         $address->getCountry();
00083         $address->explodeStreetAddress();
00084 
00085         $formater = new Varien_Filter_Template();
00086         $data = $address->getData();
00087         if ($this->getType()->getHtmlEscape()) {
00088             foreach ($data as $key => $value) {
00089                 $data[$key] = $this->htmlEscape($value);
00090             }
00091         }
00092         $formater->setVariables(array_merge($data, array('country'=>$address->getCountryModel()->getName())));
00093 
00094         $format = !is_null($format) ? $format : $this->getFormat($address);
00095 
00096         return $formater->filter($format);
00097     }

setType ( Varien_Object type  ) 

Retrive format type object

Parameters:
Varien_Object $type
Returns:
Mage_Customer_Model_Address_Renderer_Default

Implements Mage_Customer_Block_Address_Renderer_Interface.

Definition at line 60 of file Default.php.

00061     {
00062         $this->_type = $type;
00063         return $this;
00064     }


Member Data Documentation

$_type [protected]

Definition at line 42 of file Default.php.


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

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