|
MediaWiki REL1_39
|
This abstract base class helps migrate core and extension code to use the actor table. More...

Public Member Functions | |
| __construct ( $fieldInfos, $stage, ActorStoreFactory $actorStoreFactory, $options=[]) | |
| getInsertValues (IDatabase $dbw, $key, UserIdentity $user) | |
| Get UPDATE fields for the actor. | |
| getInsertValuesWithTempTable (IDatabase $dbw, $key, UserIdentity $user) | |
| Get UPDATE fields for the actor. | |
| getJoin ( $key) | |
| Get SELECT fields and joins for the actor key. | |
| getWhere (IDatabase $db, $key, $users, $useId=true) | |
| Get WHERE condition for the actor. | |
| isAnon ( $field) | |
| Return an SQL condition to test if a user field is anonymous. | |
| isNotAnon ( $field) | |
| Return an SQL condition to test if a user field is non-anonymous. | |
Protected Member Functions | |
| checkDeprecation ( $key) | |
| Issue deprecation warning/error as appropriate. | |
| getFieldInfo ( $key) | |
| Get config information about a field. | |
| getInstanceName () | |
| Get a name for this instance to use in error messages. | |
This abstract base class helps migrate core and extension code to use the actor table.
Definition at line 35 of file ActorMigrationBase.php.
| ActorMigrationBase::__construct | ( | $fieldInfos, | |
| $stage, | |||
| ActorStoreFactory | $actorStoreFactory, | ||
| $options = [] ) |
| array | $fieldInfos | An array of associative arrays, giving configuration information about fields which are being migrated. Subkeys are:
|
| int | $stage | The migration stage. This is a combination of SCHEMA_COMPAT_* flags:
|
| ActorStoreFactory | $actorStoreFactory | |
| array | $options | Array of other options. May contain:
|
Definition at line 97 of file ActorMigrationBase.php.
References SCHEMA_COMPAT_READ_MASK, SCHEMA_COMPAT_READ_NEW, SCHEMA_COMPAT_READ_OLD, SCHEMA_COMPAT_READ_TEMP, SCHEMA_COMPAT_WRITE_MASK, SCHEMA_COMPAT_WRITE_NEW, SCHEMA_COMPAT_WRITE_OLD, and SCHEMA_COMPAT_WRITE_TEMP.
|
protected |
Issue deprecation warning/error as appropriate.
| string | $key |
Definition at line 176 of file ActorMigrationBase.php.
References getFieldInfo(), and wfDeprecated().
Referenced by getInsertValues(), getInsertValuesWithTempTable(), getJoin(), and getWhere().
|
protected |
Get config information about a field.
| string | $key |
Definition at line 142 of file ActorMigrationBase.php.
References getInstanceName().
Referenced by checkDeprecation(), and getInsertValuesWithTempTable().
| ActorMigrationBase::getInsertValues | ( | IDatabase | $dbw, |
| $key, | |||
| UserIdentity | $user ) |
Get UPDATE fields for the actor.
| IDatabase | $dbw | Database to use for creating an actor ID, if necessary |
| string | $key | A key such as "rev_user" identifying the actor field being fetched. |
| UserIdentity | $user | User to set in the update |
$values to IDatabase->update() or $a to IDatabase->insert() Reimplemented in ActorMigration.
Definition at line 307 of file ActorMigrationBase.php.
References checkDeprecation(), Wikimedia\Rdbms\IDatabase\getDomainID(), MediaWiki\User\UserIdentity\getId(), MediaWiki\User\UserIdentity\getName(), SCHEMA_COMPAT_WRITE_NEW, SCHEMA_COMPAT_WRITE_OLD, and SCHEMA_COMPAT_WRITE_TEMP.
| ActorMigrationBase::getInsertValuesWithTempTable | ( | IDatabase | $dbw, |
| $key, | |||
| UserIdentity | $user ) |
Get UPDATE fields for the actor.
| IDatabase | $dbw | Database to use for creating an actor ID, if necessary |
| string | $key | A key such as "rev_user" identifying the actor field being fetched. |
| UserIdentity | $user | User to set in the update |
$values to IDatabase->update() or $a to IDatabase->insert()Reimplemented in ActorMigration.
Definition at line 342 of file ActorMigrationBase.php.
References checkDeprecation(), Wikimedia\Rdbms\IDatabase\getDomainID(), getFieldInfo(), MediaWiki\User\UserIdentity\getId(), MediaWiki\User\UserIdentity\getName(), SCHEMA_COMPAT_WRITE_NEW, SCHEMA_COMPAT_WRITE_OLD, SCHEMA_COMPAT_WRITE_TEMP, Wikimedia\Rdbms\IDatabase\upsert(), and wfDeprecated().
|
protected |
Get a name for this instance to use in error messages.
| ReflectionException |
Definition at line 160 of file ActorMigrationBase.php.
Referenced by getFieldInfo().
| ActorMigrationBase::getJoin | ( | $key | ) |
Get SELECT fields and joins for the actor key.
| string | $key | A key such as "rev_user" identifying the actor field being fetched. |
$table to IDatabase->select() or SelectQueryBuilder::tables$vars to IDatabase->select() or SelectQueryBuilder::fields$join_conds to IDatabase->select() or SelectQueryBuilder::joinConds All tables, fields, and joins are aliased, so + is safe to use. Reimplemented in ActorMigration.
Definition at line 245 of file ActorMigrationBase.php.
References checkDeprecation(), SCHEMA_COMPAT_READ_OLD, and SCHEMA_COMPAT_READ_TEMP.
Get WHERE condition for the actor.
| IDatabase | $db | Database to use for quoting and list-making |
| string | $key | A key such as "rev_user" identifying the actor field being fetched. |
| UserIdentity | UserIdentity[] | null | false | $users | Users to test for. Passing null, false, or the empty array will return 'conds' that never match, and an empty array for 'orconds'. |
| bool | $useId | If 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). |
$table to IDatabase->select() or SelectQueryBuilder::tables$cond to IDatabase->select() or SelectQueryBuilder::conds$join_conds to IDatabase->select() or SelectQueryBuilder::joinConds All tables and joins are aliased, so + is safe to use. Reimplemented in ActorMigration.
Definition at line 439 of file ActorMigrationBase.php.
References checkDeprecation(), Wikimedia\Rdbms\IDatabase\getDomainID(), Wikimedia\Rdbms\Platform\ISQLPlatform\makeList(), SCHEMA_COMPAT_READ_NEW, and SCHEMA_COMPAT_READ_TEMP.
| ActorMigrationBase::isAnon | ( | $field | ) |
Return an SQL condition to test if a user field is anonymous.
| string | $field | Field name or SQL fragment |
Definition at line 197 of file ActorMigrationBase.php.
References SCHEMA_COMPAT_READ_TEMP.
| ActorMigrationBase::isNotAnon | ( | $field | ) |
Return an SQL condition to test if a user field is non-anonymous.
| string | $field | Field name or SQL fragment |
Definition at line 206 of file ActorMigrationBase.php.
References SCHEMA_COMPAT_READ_TEMP.