| 1 | <?php |
||
| 5 | class ConfigItem implements ConfigItemInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var mixed |
||
| 9 | */ |
||
| 10 | protected $value; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var array |
||
| 14 | */ |
||
| 15 | protected $metaData = []; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var array |
||
| 19 | */ |
||
| 20 | protected $history = []; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var boolean |
||
| 24 | */ |
||
| 25 | protected $trackHistory = true; |
||
| 26 | |||
| 27 | 22 | public function __construct($value, array $metaData = [], $trackHistory = true) |
|
| 33 | |||
| 34 | 22 | public function set($value, $metaData = []) |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @return mixed |
||
| 48 | */ |
||
| 49 | 22 | public function getValue() |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @return array |
||
| 56 | */ |
||
| 57 | 22 | public function getMetaData() |
|
| 61 | |||
| 62 | /** |
||
| 63 | * Fetch the item history ordered in descending order by data |
||
| 64 | * |
||
| 65 | * @return CollectionItemInterface[] |
||
| 66 | */ |
||
| 67 | 1 | public function getHistory() |
|
| 71 | |||
| 72 | /** |
||
| 73 | * History is an array of historical records of itself so we clear it to prevent |
||
| 74 | * recursion. |
||
| 75 | */ |
||
| 76 | 22 | public function __clone() |
|
| 80 | } |
||
| 81 |