Exemple #1
0
 public static function getCartsOfOwner($cartowner = 'notset')
 {
     if ($cartowner == 'notset') {
         $cartowner = Yii::app()->User->getState('cartowner');
     }
     return ShoppingCart::model()->findAll('cartowner = :cartowner', array(':cartowner' => $cartowner));
 }
 public function loadModel()
 {
     if ($this->_model === null) {
         if (isset($_GET['id'])) {
             $this->_model = ShoppingCart::model()->findbyPk($_GET['id']);
         }
         if ($this->_model === null) {
             throw new CHttpException(404, 'The requested page does not exist.');
         }
     }
     return $this->_model;
 }