1 | <?php |
||
13 | class LogList implements JsonSerializable { |
||
14 | |||
15 | /** |
||
16 | * @var Log[] |
||
17 | */ |
||
18 | private $logs; |
||
19 | |||
20 | /** |
||
21 | * @param Log[] $logs |
||
22 | */ |
||
23 | 1 | public function __construct( $logs = array() ) { |
|
27 | |||
28 | /** |
||
29 | * @param Log[]|LogList $logs |
||
30 | * |
||
31 | * @throws InvalidArgumentException |
||
32 | */ |
||
33 | 1 | public function addLogs( $logs ) { |
|
44 | |||
45 | /** |
||
46 | * @param Log $log |
||
47 | */ |
||
48 | 1 | public function addLog( Log $log ) { |
|
51 | |||
52 | /** |
||
53 | * @param int $id |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | public function hasLogWithId( $id ){ |
||
60 | |||
61 | /** |
||
62 | * @param Log $log |
||
63 | * |
||
64 | * @return bool |
||
65 | */ |
||
66 | public function hasLog( Log $log ){ |
||
69 | |||
70 | /** |
||
71 | * @return Log|null Log or null if there is no log |
||
72 | */ |
||
73 | public function getLatest() { |
||
79 | |||
80 | /** |
||
81 | * @since 0.6 |
||
82 | * @return Log|null Log or null if there is no log |
||
83 | */ |
||
84 | public function getOldest() { |
||
90 | |||
91 | /** |
||
92 | * @since 0.6 |
||
93 | * @return bool |
||
94 | */ |
||
95 | public function isEmpty() { |
||
98 | |||
99 | /** |
||
100 | * @param int $id |
||
101 | * |
||
102 | * @throws RuntimeException |
||
103 | * @return Log |
||
104 | */ |
||
105 | public function get( $id ){ |
||
111 | |||
112 | /** |
||
113 | * @return Log[] |
||
114 | */ |
||
115 | 1 | public function toArray() { |
|
118 | |||
119 | /** |
||
120 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
121 | */ |
||
122 | 1 | public function jsonSerialize() { |
|
125 | |||
126 | /** |
||
127 | * @param array $json |
||
128 | * |
||
129 | * @return self |
||
130 | */ |
||
131 | 1 | public static function jsonDeserialize( $json ) { |
|
138 | } |