refactore currency calculations in ProductSaleElements

This commit is contained in:
Julien Chanséaume
2014-04-28 12:07:45 +02:00
parent b86ac88ce4
commit 3bacb0a917
5 changed files with 164 additions and 99 deletions

View File

@@ -0,0 +1,76 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace Thelia\Model\Tools;
/**
* Utility class used to store price and promo price for a carte item.
*
* Class ProductPriceTools
* @package Thelia\Model\Tools
* @author Julien Chanséaume <jchanseaume@openstudio.fr>
*/
class ProductPriceTools
{
/**
* The value for the price field.
*
* @var double
*/
protected $price;
/**
* The value for the promoPrice field.
*
* @var double
*/
protected $promoPrice;
public function __construct($price, $promoPrice)
{
$this->price = $price;
$this->promoPrice = $promoPrice;
}
/**
* @param float $price
*/
public function setPrice($price)
{
$this->price = $price;
}
/**
* @return float
*/
public function getPrice()
{
return $this->price;
}
/**
* @param float $promoPrice
*/
public function setPromoPrice($promoPrice)
{
$this->promoPrice = $promoPrice;
}
/**
* @return float
*/
public function getPromoPrice()
{
return $this->promoPrice;
}
}