00001 <?php 00002 00006 class oxOutOfStockException extends oxArticleException 00007 { 00008 00014 private $_iRemainingAmount = 0; 00015 00021 private $_sBasketIndex = null; 00022 00028 public function setRemainingAmount($iRemainingAmount) 00029 { 00030 $this->_iRemainingAmount = (int) $iRemainingAmount; 00031 } 00032 00038 public function getRemainingAmount() 00039 { 00040 return $this->_iRemainingAmount; 00041 } 00042 00048 public function setBasketIndex($sBasketIndex) 00049 { 00050 $this->_sBasketIndex = $sBasketIndex; 00051 } 00052 00058 public function getBasketIndex() 00059 { 00060 return $this->_sBasketIndex; 00061 } 00062 00069 public function getString() 00070 { 00071 return __CLASS__ . '-' . parent::getString() . " Remaining Amount --> " . $this->_iRemainingAmount; 00072 } 00073 00082 public function getValues() 00083 { 00084 $aRes = parent::getValues(); 00085 $aRes['remainingAmount'] = $this->getRemainingAmount(); 00086 $aRes['basketIndex'] = $this->getBasketIndex(); 00087 00088 return $aRes; 00089 } 00090 00103 public function setDestination($sDestination) 00104 { 00105 // in case destination not set, overriding default error message 00106 if (!$sDestination) { 00107 $this->message = oxRegistry::getLang()->translateString($this->getMessage()) . ": " . $this->getRemainingAmount(); 00108 } else { 00109 $this->message = oxRegistry::getLang()->translateString($this->getMessage()) . ": "; 00110 } 00111 } 00112 }