energine
[ class tree: energine ] [ index: energine ] [ all elements ]

Source for file BasketList.class.php

Documentation is available at BasketList.class.php

  1. <?php
  2. /**
  3.  * Содержит класс BasketList
  4.  *
  5.  * @package energine
  6.  * @subpackage shop
  7.  * @author dr.Pavka
  8.  * @copyright ColoCall 2007
  9.  * @version $Id$
  10.  */
  11.  
  12. /**
  13.  * Класс выводящий содержимое корзины, не для редактирования
  14.  *
  15.  * @package energine
  16.  * @subpackage shop
  17.  * @author dr.Pavka
  18.  */
  19. class BasketList extends DataSet {
  20.     /**
  21.      * Объект - корзина
  22.      *
  23.      * @var Basket 
  24.      * @access private
  25.      */
  26.     private $basket;
  27.  
  28.     /**
  29.      * Конструктор класса
  30.      *
  31.      * @param string $name 
  32.      * @param string $module 
  33.      * @param Document $document 
  34.      * @param array $params 
  35.      * @access public
  36.      */
  37.     public function __construct($name$moduleDocument $documentarray $params null{
  38.         parent::__construct($name$module$document$params);
  39.         $this->basket = Basket::getInstance();
  40.         //$this->discounts = Discounts::getInstance();
  41.         $this->setType(self::COMPONENT_TYPE_LIST);
  42.         $this->setTitle($this->translate('TXT_BASKET_CONTENTS'));
  43.     }
  44.  
  45.     /**
  46.      * Загружаем данные
  47.      *
  48.      * @return array 
  49.      * @access protected
  50.      */
  51.  
  52.      protected function loadData({
  53.         $result $this->basket->getFormattedContents();
  54.         if (!empty($result)) {
  55.             $this->addTranslation('TXT_BASKET_SUMM2');
  56.             $this->setProperty('summ'$this->basket->getTotal());
  57.         }
  58.         else {
  59.             //Если корзина пустая - добавляем перевод сообщения
  60.             $this->addTranslation('TXT_BASKET_EMPTY');
  61.         }
  62. //inspect($result);
  63.         return $result;
  64.      }
  65.  
  66. }
В создании документации нам помог: phpDocumentor