1 | <?php |
||
5 | class InMemoryRegistry implements Registry |
||
6 | { |
||
7 | /** |
||
8 | * @var SnapshotMaker |
||
9 | */ |
||
10 | private $snapshotMaker; |
||
11 | |||
12 | /** |
||
13 | * @var PropertyCloner |
||
14 | */ |
||
15 | private $recoveryPoint; |
||
16 | |||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | private $objects; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private $snapshots; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | private $removed; |
||
31 | |||
32 | /** |
||
33 | * @param SnapshotMaker $snapshotMaker |
||
34 | * @param PropertyCloner $recoveryPoint |
||
35 | */ |
||
36 | public function __construct(SnapshotMaker $snapshotMaker, PropertyCloner $recoveryPoint) |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function isRegistered($object) |
||
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | public function register($object) |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | public function getSnapshot($object) |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | public function makeNewSnapshots() |
||
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | public function isRemoved($object) |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | public function remove($object) |
||
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | public function cleanRemoved() |
||
112 | |||
113 | /** |
||
114 | * {@inheritdoc} |
||
115 | */ |
||
116 | public function all() |
||
120 | |||
121 | /** |
||
122 | * {@inheritdoc} |
||
123 | */ |
||
124 | public function reset() |
||
132 | |||
133 | /** |
||
134 | * @param $entity |
||
135 | * @return string |
||
136 | */ |
||
137 | private function getId($entity) |
||
141 | } |
||
142 |