/home/sharedstore/public_html/prestashop.sharedstore.ma/src/Core/Cart
Edit: /home/sharedstore/public_html/prestashop.sharedstore.ma/src/Core/Cart/CartRuleData.php (2168B)
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/
namespace PrestaShop\PrestaShop\Core\Cart;
class CartRuleData
{
protected $ruleData = [];
/**
* @var AmountImmutable
*/
protected $discountApplied;
public function __construct($rowData)
{
$this->setRuleData($rowData);
$this->discountApplied = new AmountImmutable();
}
/**
* @param array $ruleData
*
* @return static
*/
public function setRuleData($ruleData)
{
$this->ruleData = $ruleData;
return $this;
}
/**
* @return array
*/
public function getRuleData()
{
return $this->ruleData;
}
/**
* @return \CartRule
*/
public function getCartRule()
{
$cartRuleData = $this->getRuleData();
return $cartRuleData['obj'];
}
public function addDiscountApplied(AmountImmutable $amount)
{
$this->discountApplied = $this->discountApplied->add($amount);
}
/**
* @return AmountImmutable
*/
public function getDiscountApplied()
{
return $this->discountApplied;
}
}