BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
ActorMigration Class Reference

Public Member Functions

 __construct ($stage)
 
 isAnon ($field)
 
 isNotAnon ($field)
 
 getJoin ($key)
 
 getInsertValues (IDatabase $dbw, $key, UserIdentity $user)
 
 getInsertValuesWithTempTable (IDatabase $dbw, $key, UserIdentity $user)
 
 getWhere (IDatabase $db, $key, $users, $useId=true)
 

Static Public Member Functions

static newMigration ()
 

Detailed Description

This class handles the logic for the actor table migration.

This is not intended to be a long-term part of MediaWiki; it will be deprecated and removed along with $wgActorTableSchemaMigrationStage.

Since
1.31

Member Function Documentation

ActorMigration::getInsertValues ( IDatabase  $dbw,
  $key,
UserIdentity  $user 
)

Get UPDATE fields for the actor

Parameters
IDatabase$dbwDatabase to use for creating an actor ID, if necessary
string$keyA key such as "rev_user" identifying the actor field being fetched.
UserIdentity$userUser to set in the update
Returns
array to merge into $values to IDatabase->update() or $a to IDatabase->insert()
ActorMigration::getInsertValuesWithTempTable ( IDatabase  $dbw,
  $key,
UserIdentity  $user 
)

Get UPDATE fields for the actor

Parameters
IDatabase$dbwDatabase to use for creating an actor ID, if necessary
string$keyA key such as "rev_user" identifying the actor field being fetched.
UserIdentity$userUser to set in the update
Returns
array with two values:
  • array to merge into $values to IDatabase->update() or $a to IDatabase->insert()
  • callback to call with the the primary key for the main table insert and extra fields needed for the temp table.
ActorMigration::getJoin (   $key)

Get SELECT fields and joins for the actor key

Parameters
string$keyA key such as "rev_user" identifying the actor field being fetched.
Returns
array With three keys:
  • tables: (string[]) to include in the $table to IDatabase->select()
  • fields: (string[]) to include in the $vars to IDatabase->select()
  • joins: (array) to include in the $join_conds to IDatabase->select() All tables, fields, and joins are aliased, so + is safe to use.
ActorMigration::getWhere ( IDatabase  $db,
  $key,
  $users,
  $useId = true 
)

Get WHERE condition for the actor

Parameters
IDatabase$dbDatabase to use for quoting and list-making
string$keyA key such as "rev_user" identifying the actor field being fetched.
UserIdentity|UserIdentity[]$users Users to test for
bool$useIdIf false, don't try to query by the user ID. Intended for use with rc_user since it has an index on (rc_user_text,rc_timestamp) but not (rc_user,rc_timestamp).
Returns
array With three keys:
  • tables: (string[]) to include in the $table to IDatabase->select()
  • conds: (string) to include in the $cond to IDatabase->select()
  • orconds: (array[]) array of alternatives in case a union of multiple queries would be more efficient than a query with OR. May have keys 'actor', 'userid', 'username'.
  • joins: (array) to include in the $join_conds to IDatabase->select() All tables and joins are aliased, so + is safe to use.
ActorMigration::isAnon (   $field)

Return an SQL condition to test if a user field is anonymous

Parameters
string$fieldField name or SQL fragment
Returns
string
ActorMigration::isNotAnon (   $field)

Return an SQL condition to test if a user field is non-anonymous

Parameters
string$fieldField name or SQL fragment
Returns
string
static ActorMigration::newMigration ( )
static

Static constructor

Returns
ActorMigration

The documentation for this class was generated from the following file: