00001 <?php 00002 00007 class oxAmountPriceList extends oxList 00008 { 00009 00015 protected $_sObjectsInListName = 'oxprice2article'; 00016 00022 protected $_oArticle = null; 00023 00029 public function getArticle() 00030 { 00031 return $this->_oArticle; 00032 } 00033 00039 public function setArticle($oArticle) 00040 { 00041 $this->_oArticle = $oArticle; 00042 } 00043 00049 public function __construct() 00050 { 00051 parent::__construct('oxbase'); 00052 $this->init('oxbase', 'oxprice2article'); 00053 } 00054 00060 protected function _loadFromDb() 00061 { 00062 $sArticleId = $this->getArticle()->getId(); 00063 00064 if (!$this->isAdmin() && $this->getConfig()->getConfigParam('blVariantInheritAmountPrice') && $this->getArticle()->getParentId()) { 00065 $sArticleId = $this->getArticle()->getParentId(); 00066 } 00067 00068 if ($this->getConfig()->getConfigParam('blMallInterchangeArticles')) { 00069 $sShopSelect = '1'; 00070 } else { 00071 $sShopSelect = " `oxshopid` = " . oxDb::getDb()->quote($this->getConfig()->getShopId()) . " "; 00072 } 00073 00074 $sSql = "SELECT * FROM `oxprice2article` WHERE `oxartid` = " . oxDb::getDb()->quote($sArticleId) . " AND $sShopSelect ORDER BY `oxamount` "; 00075 00076 $aData = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getAll($sSql); 00077 00078 return $aData; 00079 } 00080 00081 00087 public function load($oArticle) 00088 { 00089 $this->setArticle($oArticle); 00090 00091 00092 $aData = $this->_loadFromDb(); 00093 00094 $this->assignArray($aData); 00095 } 00096 }