1 | <?php |
||
20 | class Journal implements JournalInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var JournalEntryFactoryInterface |
||
24 | */ |
||
25 | private $journalEntryFactory; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | private $entries = []; |
||
31 | |||
32 | /** |
||
33 | * @var int |
||
34 | */ |
||
35 | private $limit = 10; |
||
36 | |||
37 | /** |
||
38 | * @param JournalEntryFactoryInterface|null $journalEntryFactory |
||
39 | */ |
||
40 | 108 | public function __construct(JournalEntryFactoryInterface $journalEntryFactory = null) |
|
41 | { |
||
42 | 108 | $this->setJournalEntryFactory($journalEntryFactory ?: new JournalEntryFactory()); |
|
43 | 108 | } |
|
44 | |||
45 | /** |
||
46 | * @return JournalEntryFactoryInterface |
||
47 | */ |
||
48 | 18 | public function getJournalEntryFactory() |
|
52 | |||
53 | /** |
||
54 | * @param JournalEntryFactoryInterface $journalEntryFactory |
||
55 | */ |
||
56 | 108 | public function setJournalEntryFactory(JournalEntryFactoryInterface $journalEntryFactory) |
|
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | 9 | public function record(InternalRequestInterface $request, ResponseInterface $response) |
|
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | 36 | public function clear() |
|
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | 72 | public function hasEntries() |
|
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | 81 | public function getEntries() |
|
92 | |||
93 | /** |
||
94 | * {@inheritdoc} |
||
95 | */ |
||
96 | 36 | public function setEntries(array $entries) |
|
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | 36 | public function addEntries(array $entries) |
|
111 | |||
112 | /** |
||
113 | * {@inheritdoc} |
||
114 | */ |
||
115 | 9 | public function removeEntries(array $entries) |
|
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | 72 | public function hasEntry(JournalEntryInterface $entry) |
|
129 | |||
130 | /** |
||
131 | * {@inheritdoc} |
||
132 | */ |
||
133 | 72 | public function addEntry(JournalEntryInterface $entry) |
|
140 | |||
141 | /** |
||
142 | * {@inheritdoc} |
||
143 | */ |
||
144 | 18 | public function removeEntry(JournalEntryInterface $entry) |
|
151 | |||
152 | /** |
||
153 | * {@inheritdoc} |
||
154 | */ |
||
155 | 27 | public function getLimit() |
|
159 | |||
160 | /** |
||
161 | * {@inheritdoc} |
||
162 | */ |
||
163 | 9 | public function setLimit($limit) |
|
167 | |||
168 | /** |
||
169 | * {@inheritdoc} |
||
170 | */ |
||
171 | 72 | public function count() |
|
175 | |||
176 | /** |
||
177 | * {@inheritdoc} |
||
178 | */ |
||
179 | 72 | public function getIterator() |
|
183 | } |
||
184 |