* @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; } }