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