3 namespace MediaWiki\User
;
5 use MediaWiki\MediaWikiServices
;
6 use Wikimedia\Rdbms\IDatabase
;
7 use Wikimedia\Rdbms\IReadableDatabase
;
10 * This is not intended to be a long-term part of MediaWiki; it will be
11 * deprecated and removed once actor migration is complete.
14 * @since 1.34 Use with 'ar_user', 'img_user', 'oi_user', 'fa_user',
15 * 'rc_user', 'log_user', and 'ipb_by' is deprecated. Callers should
16 * reference the corresponding actor fields directly.
17 * @deprecated since 1.39
19 class ActorMigration
extends ActorMigrationBase
{
21 * Constant for extensions to feature-test whether $wgActorTableSchemaMigrationStage
22 * (in MW <1.34) expects MIGRATION_* or SCHEMA_COMPAT_*
24 public const MIGRATION_STAGE_SCHEMA_COMPAT
= 1;
28 * @see ActorMigrationBase::getFieldInfo()
30 public const FIELD_INFOS
= [
31 // Deprecated since 1.39
39 public static function newMigration() {
40 return MediaWikiServices
::getInstance()->getActorMigration();
47 public static function newMigrationForImport() {
48 $migration = new self(
49 MediaWikiServices
::getInstance()->getActorStoreFactory()
51 $migration->setForImport( true );
58 * @param ActorStoreFactory $actorStoreFactory
60 public function __construct( ActorStoreFactory
$actorStoreFactory ) {
70 * @deprecated since 1.39 Use `{table} JOIN actor ON {table_prefix}_actor = actor_id`
71 * E.g. for key=rev_user, use `revision JOIN actor ON rev_actor = actor_id`
73 public function getJoin( $key ) {
74 return parent
::getJoin( $key );
79 * @deprecated since 1.39 Use `{table_prefix}_actor IN ({list of actor IDs})`.
80 * E.g. for key=rev_user, use `rev_actor IN ({list of actor IDs})`.
81 * Use `MediaWikiServices::getInstance()->getActorNormalization()
82 * ->findActorId( $user, $db )` to get the actor ID for a given user.
84 public function getWhere( IReadableDatabase
$db, $key, $users, $useId = true ) {
85 return parent
::getWhere( $db, $key, $users, $useId );
90 * @deprecated since 1.39 Use `[ '{table_prefix}_actor' => MediaWikiServices::getInstance()
91 * ->getActorNormalization()->acquireActorId( $user, $dbw ) ]`
92 * E.g. for key=log_user, use `[ 'log_actor' => ... ]`
94 public function getInsertValues( IDatabase
$dbw, $key, UserIdentity
$user ) {
95 return parent
::getInsertValues( $dbw, $key, $user );
100 /** @deprecated class alias since 1.40 */
101 class_alias( ActorMigration
::class, 'ActorMigration' );