MediaWiki master
LoggingSelectQueryBuilder.php
Go to the documentation of this file.
1<?php
22
25
32
37 public function __construct( IReadableDatabase $db ) {
38 parent::__construct( $db );
39 $this->select( [
40 'log_id', 'log_type', 'log_action', 'log_timestamp',
41 'log_namespace', 'log_title', // unused log_page
42 'log_params', 'log_deleted',
43 'user_id',
44 'user_name',
45 'log_actor',
46 'log_user' => 'logging_actor.actor_user',
47 'log_user_text' => 'logging_actor.actor_name',
48 'log_comment_text' => 'comment_log_comment.comment_text',
49 'log_comment_data' => 'comment_log_comment.comment_data',
50 'log_comment_cid' => 'comment_log_comment.comment_id',
51 ] )
52 ->from( 'logging' )
53 ->join( 'actor', 'logging_actor', 'actor_id=log_actor' )
54 ->leftJoin( 'user', null, 'user_id=logging_actor.actor_user' )
55 ->join(
56 'comment',
57 'comment_log_comment',
58 'comment_log_comment.comment_id = log_comment_id'
59 );
60 }
61
62}
Help and centralize querying logging table.
Build SELECT queries with a fluent interface.
IReadableDatabase IReadableDatabase $db
select( $fields)
Add a field or an array of fields to the query.
A database connection without write operations.