OXID eShop CE  4.9.7
 All Classes Files Functions Variables Pages
oxamountpricelist.php
Go to the documentation of this file.
1 <?php
2 
7 class oxAmountPriceList extends oxList
8 {
9 
15  protected $_sObjectsInListName = 'oxprice2article';
16 
22  protected $_oArticle = null;
23 
29  public function getArticle()
30  {
31  return $this->_oArticle;
32  }
33 
39  public function setArticle($oArticle)
40  {
41  $this->_oArticle = $oArticle;
42  }
43 
49  public function __construct()
50  {
51  parent::__construct('oxbase');
52  $this->init('oxbase', 'oxprice2article');
53  }
54 
60  protected function _loadFromDb()
61  {
62  $sArticleId = $this->getArticle()->getId();
63 
64  if (!$this->isAdmin() && $this->getConfig()->getConfigParam('blVariantInheritAmountPrice') && $this->getArticle()->getParentId()) {
65  $sArticleId = $this->getArticle()->getParentId();
66  }
67 
68  if ($this->getConfig()->getConfigParam('blMallInterchangeArticles')) {
69  $sShopSelect = '1';
70  } else {
71  $sShopSelect = " `oxshopid` = " . oxDb::getDb()->quote($this->getConfig()->getShopId()) . " ";
72  }
73 
74  $sSql = "SELECT * FROM `oxprice2article` WHERE `oxartid` = " . oxDb::getDb()->quote($sArticleId) . " AND $sShopSelect ORDER BY `oxamount` ";
75 
76  $aData = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getAll($sSql);
77 
78  return $aData;
79  }
80 
81 
87  public function load($oArticle)
88  {
89  $this->setArticle($oArticle);
90 
91 
92  $aData = $this->_loadFromDb();
93 
94  $this->assignArray($aData);
95  }
96 }