oxoutofstockexception.php

Go to the documentation of this file.
00001 <?php
00002 
00006 class oxOutOfStockException extends oxArticleException
00007 {
00013     private $_iRemainingAmount = 0;
00014 
00020     private $_sBasketIndex = null;
00021 
00029     public function setRemainingAmount( $iRemainingAmount )
00030     {
00031         $this->_iRemainingAmount = (int) $iRemainingAmount;
00032     }
00033 
00039     public function getRemainingAmount()
00040     {
00041         return $this->_iRemainingAmount;
00042     }
00043 
00051     public function setBasketIndex( $sBasketIndex )
00052     {
00053         $this->_sBasketIndex = $sBasketIndex;
00054     }
00055 
00061     public function getBasketIndex()
00062     {
00063         return $this->_sBasketIndex;
00064     }
00065 
00072     public function getString()
00073     {
00074         return __CLASS__.'-'.parent::getString()." Remaining Amount --> ".$this->_iRemainingAmount;
00075     }
00076 
00085     public function getValues()
00086     {
00087         $aRes = parent::getValues();
00088         $aRes['remainingAmount'] = $this->getRemainingAmount();
00089         $aRes['basketIndex'] = $this->getBasketIndex();
00090         return $aRes;
00091     }
00092 
00107     public function setDestination( $sDestination )
00108     {
00109         // in case destination not set, overriding default error message
00110         if ( !$sDestination ) {
00111             $this->message = oxRegistry::getLang()->translateString( $this->getMessage() ) . ": " . $this->getRemainingAmount();
00112         } else {
00113             $this->message = oxRegistry::getLang()->translateString( $this->getMessage() ) . ": ";
00114         }
00115     }
00116 }