MediaWiki master
LoggingSelectQueryBuilder.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Logging;
8
11
18
23 public function __construct( IReadableDatabase $db ) {
24 parent::__construct( $db );
25 $this->select( [
26 'log_id', 'log_type', 'log_action', 'log_timestamp',
27 'log_namespace', 'log_title', // unused log_page
28 'log_params', 'log_deleted',
29 'user_id',
30 'user_name',
31 'log_actor',
32 'log_user' => 'logging_actor.actor_user',
33 'log_user_text' => 'logging_actor.actor_name',
34 'log_comment_text' => 'comment_log_comment.comment_text',
35 'log_comment_data' => 'comment_log_comment.comment_data',
36 'log_comment_cid' => 'comment_log_comment.comment_id',
37 ] )
38 ->from( 'logging' )
39 ->join( 'actor', 'logging_actor', 'actor_id=log_actor' )
40 ->leftJoin( 'user', null, 'user_id=logging_actor.actor_user' )
41 ->join(
42 'comment',
43 'comment_log_comment',
44 'comment_log_comment.comment_id = log_comment_id'
45 );
46 }
47
48}
Help and centralize querying logging table.
Build SELECT queries with a fluent interface.
select( $fields)
Add a field or an array of fields to the query.
A database connection without write operations.