| 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 $trackMetadata = false ; |
||
| 26 | |||
| 27 | 25 | public function __construct($value, array $metaData = [], $trackMetadata = false) |
|
| 35 | |||
| 36 | 23 | public function set($value, $metaData = []) |
|
| 47 | |||
| 48 | /** |
||
| 49 | * @return mixed |
||
| 50 | */ |
||
| 51 | 25 | public function getValue() |
|
| 55 | |||
| 56 | /** |
||
| 57 | * @return array |
||
| 58 | */ |
||
| 59 | 25 | public function getMetadata() |
|
| 63 | |||
| 64 | /** |
||
| 65 | * Fetch the item history ordered in descending order by data |
||
| 66 | * |
||
| 67 | * @return CollectionItemInterface[] |
||
| 68 | */ |
||
| 69 | 1 | public function getHistory() |
|
| 73 | |||
| 74 | 22 | public function trackMetadata($track) |
|
| 78 | |||
| 79 | /** |
||
| 80 | * History is an array of historical records of itself so we clear it to prevent |
||
| 81 | * recursion. |
||
| 82 | */ |
||
| 83 | 2 | public function __clone() |
|
| 87 | } |
||
| 88 |