account_order.php

Go to the documentation of this file.
00001 <?php
00002 
00011 class Account_Order extends Account
00012 {
00013 
00018     protected $_sThisTemplate = 'account_order.tpl';
00019 
00025     protected $_aOrderList = null;
00026 
00032     protected $_aArticlesList  = null;
00033 
00044     public function render()
00045     {
00046         parent::render();
00047 
00048         // is logged in ?
00049         $oUser = $this->getUser();
00050         if ( !$oUser ) {
00051             return $this->_sThisTemplate = $this->_sThisLoginTemplate;
00052         }
00053 
00054         // Load Orderlist
00055         $this->_aViewData['orderlist'] = $this->getOrderList();
00056 
00057         // Load orders articles
00058         $this->_aViewData['articlesList'] = $this->getOrderArticleList();
00059 
00060         return $this->_sThisTemplate;
00061     }
00062 
00068     public function getOrderList()
00069     {
00070         if ( $this->_aOrderList === null ) {
00071             $this->_aOrderList = false;
00072 
00073             // Load user Orderlist
00074             if ( $oUser = $this->getUser() ) {
00075                 $this->_aOrderList = $oUser->getOrders();
00076             }
00077         }
00078 
00079         return $this->_aOrderList;
00080     }
00081 
00087     public function getOrderArticleList()
00088     {
00089         if ( $this->_aArticlesList === null ) {
00090 
00091             // marking as set
00092             $this->_aArticlesList = false;
00093             $oOrdersList = $this->getOrderList();
00094             if ( $oOrdersList && $oOrdersList->count() ) {
00095                 $this->_aArticlesList = oxNew( 'oxarticlelist' );
00096                 $this->_aArticlesList->loadOrderArticles( $oOrdersList );
00097             }
00098         }
00099 
00100         return $this->_aArticlesList;
00101     }
00102 }

Generated on Thu Dec 4 12:04:57 2008 for OXID eShop CE by  doxygen 1.5.5