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 1.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 1.0 |
||
59 | */ |
||
60 | 1 | public function clearCache() { |
|
63 | |||
64 | /** |
||
65 | * Fetch the query parameters for later calls |
||
66 | * |
||
67 | * @since 1.0 |
||
68 | * |
||
69 | * @return array of parameters for SELECT call |
||
70 | */ |
||
71 | 5 | public function getQuery() { |
|
74 | |||
75 | /** |
||
76 | * @since 1.0 |
||
77 | * |
||
78 | * @param Title|null $title |
||
79 | * @param string $type |
||
80 | * |
||
81 | * @return User |
||
82 | */ |
||
83 | 4 | public function getUserForLogEntry( Title $title = null, $type = 'approval' ) { |
|
92 | |||
93 | /** |
||
94 | * @since 1.0 |
||
95 | * |
||
96 | * @param Title|null $title |
||
97 | * @param string $type |
||
98 | * |
||
99 | * @return Timestamp |
||
100 | */ |
||
101 | 2 | public function getDateOfLogEntry( Title $title = null, $type = 'approval' ) { |
|
110 | |||
111 | /** |
||
112 | * @since 1.0 |
||
113 | * |
||
114 | * @param Title|null $title |
||
115 | * @param string $type |
||
116 | * |
||
117 | * @return string |
||
118 | */ |
||
119 | 2 | public function getStatusOfLogEntry( Title $title = null, $type = 'approval' ) { |
|
128 | |||
129 | /** |
||
130 | * Take care of loading from the cache or filling the query. |
||
131 | */ |
||
132 | 4 | private function init( $title, $type ) { |
|
157 | |||
158 | /** |
||
159 | * Fetch the results using our conditions |
||
160 | * |
||
161 | * @return IResultWrapper |
||
162 | * @throws DBError |
||
163 | */ |
||
164 | 4 | private function getLog() { |
|
193 | |||
194 | } |
||
195 |