Mage_Adminhtml_Model_Search_Order Class Reference

Inheritance diagram for Mage_Adminhtml_Model_Search_Order:

Varien_Object

List of all members.

Public Member Functions

 load ()


Detailed Description

Definition at line 26 of file Order.php.


Member Function Documentation

load (  ) 

Definition at line 29 of file Order.php.

00030     {
00031         $arr = array();
00032 
00033         if (!$this->hasStart() || !$this->hasLimit() || !$this->hasQuery()) {
00034             $this->setResults($arr);
00035             return $this;
00036         }
00037 
00038         //TODO: add full name logic
00039         $collection = Mage::getResourceModel('sales/order_collection')
00040             ->addAttributeToSelect('*')
00041 
00042             ->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id')
00043             ->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id')
00044             ->joinAttribute('billing_telephone', 'order_address/telephone', 'billing_address_id')
00045             ->joinAttribute('billing_postcode', 'order_address/postcode', 'billing_address_id')
00046 
00047             ->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id')
00048             ->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id')
00049             ->joinAttribute('shipping_telephone', 'order_address/telephone', 'shipping_address_id')
00050             ->joinAttribute('shipping_postcode', 'order_address/postcode', 'shipping_address_id')
00051 
00052             ->addAttributeToFilter(array(
00053                 array('attribute'=>'increment_id', 'like'=>$this->getQuery().'%'),
00054                 array('attribute'=>'billing_firstname', 'like'=>$this->getQuery().'%'),
00055                 array('attribute'=>'billing_lastname', 'like'=>$this->getQuery().'%'),
00056                 array('attribute'=>'billing_telephone', 'like'=>$this->getQuery().'%'),
00057                 array('attribute'=>'billing_postcode', 'like'=>$this->getQuery().'%'),
00058 
00059                 array('attribute'=>'shipping_firstname', 'like'=>$this->getQuery().'%'),
00060                 array('attribute'=>'shipping_lastname', 'like'=>$this->getQuery().'%'),
00061                 array('attribute'=>'shipping_telephone', 'like'=>$this->getQuery().'%'),
00062                 array('attribute'=>'shipping_postcode', 'like'=>$this->getQuery().'%'),
00063             ))
00064 
00065             ->setCurPage($this->getStart())
00066             ->setPageSize($this->getLimit())
00067             ->load();
00068 
00069         foreach ($collection as $order) {
00070             $arr[] = array(
00071                 'id'            => 'order/1/'.$order->getId(),
00072                 'type'          => 'Order',
00073                 'name'          => Mage::helper('adminhtml')->__('Order #%s', $order->getIncrementId()),
00074                 'description'   => $order->getBillingFirstname().' '.$order->getBillingLastname(),
00075                 'form_panel_title' => Mage::helper('adminhtml')->__('Order #%s (%s)', $order->getIncrementId(), $order->getBillingFirstname().' '.$order->getBillingLastname()),
00076                 'url'           => Mage::helper('adminhtml')->getUrl('*/sales_order/view', array('order_id'=>$order->getId())),
00077             );
00078         }
00079 
00080         $this->setResults($arr);
00081 
00082         return $this;
00083     }


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

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