OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
oxbasketcontentmarkgenerator.php
Go to the documentation of this file.
1 <?php
2 
7 {
12 
18  private $_aMarks;
19 
25  private $_oBasket;
26 
32  public function __construct(oxBasket $oBasket)
33  {
34  $this->_oBasket = $oBasket;
35  }
36 
44  public function getMark($sMarkIdentification)
45  {
46  if (is_null($this->_aMarks)) {
47  $sCurrentMark = self::DEFAULT_EXPLANATION_MARK;
48  $aMarks = $this->_formMarks($sCurrentMark);
49  $this->_aMarks = $aMarks;
50  }
51 
52  return $this->_aMarks[$sMarkIdentification];
53  }
54 
60  private function _getBasket()
61  {
62  return $this->_oBasket;
63  }
64 
72  private function _formMarks($sCurrentMark)
73  {
74  $oBasket = $this->_getBasket();
75  $aMarks = array();
76  if ($oBasket->hasSkipedDiscount()) {
77  $aMarks['skippedDiscount'] = $sCurrentMark;
78  $sCurrentMark .= '*';
79  }
80  if ($oBasket->hasArticlesWithDownloadableAgreement()) {
81  $aMarks['downloadable'] = $sCurrentMark;
82  $sCurrentMark .= '*';
83  }
84  if ($oBasket->hasArticlesWithIntangibleAgreement()) {
85  $aMarks['intangible'] = $sCurrentMark;
86  }
87 
88  return $aMarks;
89  }
90 }