Mage_Catalog_Model_Entity_Product_Attribute_Frontend_Image Class Reference

Inheritance diagram for Mage_Catalog_Model_Entity_Product_Attribute_Frontend_Image:

Mage_Eav_Model_Entity_Attribute_Frontend_Abstract Mage_Eav_Model_Entity_Attribute_Frontend_Interface

List of all members.

Public Member Functions

 getUrl ($object, $size=null)


Detailed Description

Definition at line 35 of file Image.php.


Member Function Documentation

getUrl ( object,
size = null 
)

Definition at line 37 of file Image.php.

00038     {
00039         $url = false;
00040         $image = $object->getData($this->getAttribute()->getAttributeCode());
00041 
00042         if( !is_null($size) && file_exists(Mage::getBaseDir('media').'/catalog/product/'. $size . '/' . $image) ) {
00043             # image is cached
00044             $url = Mage::getBaseUrl('media').'catalog/product/' . $size . '/' . $image;
00045         } elseif( !is_null($size) ) {
00046             # image is not cached
00047             $url = Mage::getBaseUrl().'catalog/product/image/size/' . $size . '/' . $image;
00048         } else {
00049             # image is not cached
00050             $url = Mage::getBaseUrl().'catalog/product/image' . $image;
00051         }/* elseif ($image) {
00052             # using original image
00053             $url = Mage::getBaseUrl('media').'catalog/product/'.$image;
00054         }*/
00055         return $url;
00056     }


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

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