1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\CatalogRule\Observer;
class RulePricesStorage
{
/**
* Store calculated catalog rules prices for products
* Prices collected per website, customer group, date and product
*
* @var array
*/
private $rulePrices = [];
/**
* @param string $id
* @return false|float
*/
public function getRulePrice($id)
{
return $this->rulePrices[$id] ?? false;
}
/**
* @param string $id
* @return bool
*/
public function hasRulePrice($id)
{
return isset($this->rulePrices[$id]);
}
/**
* @param string $id
* @param float $price
* @return void
*/
public function setRulePrice($id, $price)
{
$this->rulePrices[$id] = $price;
}
}