Example #1
0
 /**
  * Compares this object to another oxPrice objects. Comparison is performed on brutto price.
  * Result is equal to:
  *   0 - when prices are equal.
  *   1 - when this price is larger than $oPrice.
  *  -1 - when this price is smaller than $oPrice.
  *
  * @param oxPrice $oPrice price object
  *
  * @return null
  */
 public function compare(\OxidEsales\EshopCommunity\Core\Price $oPrice)
 {
     $dBruttoPrice1 = $this->getBruttoPrice();
     $dBruttoPrice2 = $oPrice->getBruttoPrice();
     if ($dBruttoPrice1 == $dBruttoPrice2) {
         $iRes = 0;
     } elseif ($dBruttoPrice1 > $dBruttoPrice2) {
         $iRes = 1;
     } else {
         $iRes = -1;
     }
     return $iRes;
 }