1 | <?php |
||
12 | class DatabaseLogReader { |
||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private static $titleCache = []; |
||
18 | |||
19 | /** |
||
20 | * @var DatabaseBase |
||
21 | */ |
||
22 | private $dbr; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $query; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $log; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $dbKey; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $type; |
||
43 | |||
44 | /** |
||
45 | * @since 2.0 |
||
46 | * |
||
47 | * @param DatabaseaBase $dbr injected connection |
||
48 | * @param Title|null $title |
||
49 | * @param string $type of log (default: approval) |
||
50 | */ |
||
51 | 6 | public function __construct( DatabaseBase $dbr, Title $title = null , $type = 'approval' ) { |
|
56 | |||
57 | /** |
||
58 | * @since 2.0 |
||
59 | */ |
||
60 | 1 | public function clearCache() { |
|
63 | |||
64 | /** |
||
65 | * Fetch the query parameters for later calls |
||
66 | * |
||
67 | * @since 2.0 |
||
68 | * |
||
69 | * @return array of parameters for SELECT call |
||
70 | */ |
||
71 | 5 | public function getQuery() { |
|
74 | |||
75 | /** |
||
76 | * @since 2.0 |
||
77 | * |
||
78 | * @return User |
||
79 | */ |
||
80 | 4 | public function getUserForLogEntry() { |
|
88 | |||
89 | /** |
||
90 | * @since 2.0 |
||
91 | * |
||
92 | * @return Timestamp |
||
93 | */ |
||
94 | 2 | public function getDateOfLogEntry() { |
|
102 | |||
103 | /** |
||
104 | * @since 2.0 |
||
105 | * |
||
106 | * @return string |
||
107 | */ |
||
108 | 2 | public function getStatusOfLogEntry() { |
|
116 | |||
117 | /** |
||
118 | * Take care of loading from the cache or filling the query. |
||
119 | */ |
||
120 | 4 | private function init() { |
|
142 | |||
143 | /** |
||
144 | * Fetch the results using our conditions |
||
145 | * |
||
146 | * @return IResultWrapper |
||
147 | * @throws DBError |
||
148 | */ |
||
149 | 4 | private function getLog() { |
|
176 | |||
177 | } |
||
178 |