1 | <?php |
||
18 | class JournalEntry implements Record |
||
19 | { |
||
20 | use SlumberId; |
||
21 | use SlumberTimestamped; |
||
22 | use SlumberRecordUser; |
||
23 | |||
24 | /** |
||
25 | * @param string $externalReference |
||
26 | * @param array $recordData |
||
27 | * |
||
28 | * @return JournalEntry |
||
29 | */ |
||
30 | 4 | public static function create($externalReference, $recordData) |
|
38 | |||
39 | /** |
||
40 | * @var array |
||
41 | * |
||
42 | * @Slumber\AsIs() |
||
43 | */ |
||
44 | private $recordData = []; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | * |
||
49 | * @Slumber\AsString() |
||
50 | * @Slumber\Store\Indexed(background = true) |
||
51 | */ |
||
52 | private $externalReference; |
||
53 | |||
54 | /** |
||
55 | * @var bool |
||
56 | * |
||
57 | * @Slumber\AsBool() |
||
58 | * @Slumber\Store\Indexed(background = true) |
||
59 | */ |
||
60 | private $isCompacted = false; |
||
61 | |||
62 | /** |
||
63 | * @var array |
||
64 | * |
||
65 | * @Slumber\AsIs() |
||
66 | */ |
||
67 | private $compactedData = []; |
||
68 | |||
69 | /** |
||
70 | * JournalEntry constructor. |
||
71 | */ |
||
72 | 4 | public function __construct() |
|
76 | |||
77 | /** |
||
78 | * @return string |
||
79 | */ |
||
80 | 3 | public function getChangedBy() |
|
86 | |||
87 | /** |
||
88 | * Get the date of record creation |
||
89 | * |
||
90 | * @return \DateTime |
||
91 | */ |
||
92 | 3 | public function getChangeDate() |
|
96 | |||
97 | /** |
||
98 | * @param \DateTime $date |
||
99 | * |
||
100 | * @return $this |
||
101 | */ |
||
102 | 2 | public function setChangeDate(\DateTime $date) |
|
108 | |||
109 | /** |
||
110 | * @return array |
||
111 | */ |
||
112 | 3 | public function getRecordData() |
|
116 | |||
117 | /** |
||
118 | * @param array $recordData |
||
119 | * |
||
120 | * @return $this |
||
121 | */ |
||
122 | 2 | public function setRecordData($recordData) |
|
128 | |||
129 | /** |
||
130 | * @return string |
||
131 | */ |
||
132 | 1 | public function getExternalReference() |
|
136 | |||
137 | /** |
||
138 | * @param string $externalReference |
||
139 | * |
||
140 | * @return $this |
||
141 | */ |
||
142 | 2 | public function setExternalReference($externalReference) |
|
148 | |||
149 | /** |
||
150 | * @return boolean |
||
151 | */ |
||
152 | 3 | public function getIsCompacted() |
|
156 | |||
157 | /** |
||
158 | * @param boolean $isCompacted |
||
159 | * |
||
160 | * @return $this |
||
161 | */ |
||
162 | 2 | public function setIsCompacted($isCompacted) |
|
168 | |||
169 | /** |
||
170 | * @return array |
||
171 | */ |
||
172 | 2 | public function getCompactedData() |
|
176 | |||
177 | /** |
||
178 | * @param array $compactedData |
||
179 | * |
||
180 | * @return $this |
||
181 | */ |
||
182 | 2 | public function setCompactedData($compactedData) |
|
188 | |||
189 | /** |
||
190 | * @return RecordableHistory |
||
191 | */ |
||
192 | 2 | public function getCompactedHistory() |
|
235 | |||
236 | /** |
||
237 | * @param RecordableHistory $history |
||
238 | * |
||
239 | * @return $this |
||
240 | */ |
||
241 | 2 | public function setCompactedHistory(RecordableHistory $history) |
|
285 | |||
286 | } |
||
287 |