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