/**
* The type of the redirect (user/file/revision)
*
+ * Example value: `'user'`
+ *
* @var string $mType
- * @example 'user'
*/
protected $mType;
/**
* The identifier/value for the redirect (which id, which file)
*
+ * Example value: `'42'`
+ *
* @var string $mValue
- * @example '42'
*/
protected $mValue;
return null;
}
+ $logQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
+
$logparams = [
- 'log_id',
- 'log_timestamp',
- 'log_type',
- 'log_user_text',
+ 'log_id' => 'log_id',
+ 'log_timestamp' => 'log_timestamp',
+ 'log_type' => 'log_type',
+ 'log_user_text' => $logQuery['fields']['log_user_text'],
];
$dbr = wfGetDB( DB_REPLICA );
// Returns all fields mentioned in $logparams of the logs
// with the same timestamp as the one returned by the statement above
$logsSameTimestamps = $dbr->select(
- 'logging',
+ [ 'logging' ] + $logQuery['tables'],
$logparams,
- [ "log_timestamp = ($inner)" ]
+ [ "log_timestamp = ($inner)" ],
+ __METHOD__,
+ [],
+ $logQuery['joins']
);
if ( $logsSameTimestamps->numRows() === 0 ) {
return null;
// Stores all the rows with the same values in each column
// as $rowMain
- foreach ( $logparams as $cond ) {
+ foreach ( $logparams as $key => $dummy ) {
$matchedRows = [];
foreach ( $logsSameTimestamps as $row ) {
- if ( $row->$cond === $rowMain->$cond ) {
+ if ( $row->$key === $rowMain->$key ) {
$matchedRows[] = $row;
}
}
'log_user_text' => 'user'
];
- foreach ( $logparams as $logKey ) {
+ foreach ( $logparams as $logKey => $dummy ) {
$query[$keys[$logKey]] = $matchedRows[0]->$logKey;
}
$query['offset'] = $query['offset'] + 1;