Mage_Sales_Block_Order_Recent Class Reference

Inheritance diagram for Mage_Sales_Block_Order_Recent:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getViewUrl ($order)
 getTrackUrl ($order)
 getReorderUrl ($order)

Protected Member Functions

 _toHtml ()


Detailed Description

Definition at line 35 of file Recent.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 38 of file Recent.php.

00039     {
00040         parent::__construct();
00041 
00042         //TODO: add full name logic
00043         $orders = Mage::getResourceModel('sales/order_collection')
00044             ->addAttributeToSelect('*')
00045             ->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')
00046             ->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')
00047             ->addAttributeToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId())
00048             ->addAttributeToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
00049             ->addAttributeToSort('created_at', 'desc')
00050             ->setPageSize('5')
00051             ->load()
00052         ;
00053 
00054         $this->setOrders($orders);
00055     }


Member Function Documentation

_toHtml (  )  [protected]

Render block HTML

Returns:
string

Reimplemented from Mage_Core_Block_Template.

Definition at line 67 of file Recent.php.

00068     {
00069         if ($this->getOrders()->getSize() > 0) {
00070             return parent::_toHtml();
00071         }
00072         return '';
00073     }

getReorderUrl ( order  ) 

Definition at line 75 of file Recent.php.

00076     {
00077         return $this->getUrl('sales/order/reorder', array('order_id' => $order->getId()));
00078     }

getTrackUrl ( order  ) 

Definition at line 62 of file Recent.php.

00063     {
00064         return $this->getUrl('sales/order/track', array('order_id' => $order->getId()));
00065     }

getViewUrl ( order  ) 

Definition at line 57 of file Recent.php.

00058     {
00059         return $this->getUrl('sales/order/view', array('order_id' => $order->getId()));
00060     }


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

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