- /**
- * Return user specifications
- * i.e. user => id, user_text => text
- *
- * @param IDatabase $dbw Database handle
- * @param User $user User for the spec
- * @param string $idfield Field name containing the identifier
- * @param string $utfield Field name containing the user text
- * @param string $acfield Field name containing the actor ID
- * @return array
- */
- private function userSpecification( IDatabase $dbw, &$user, $idfield, $utfield, $acfield ) {
- global $wgActorTableSchemaMigrationStage;
-
- $ret = [];
- if ( $wgActorTableSchemaMigrationStage < MIGRATION_NEW ) {
- $ret += [
- $idfield => $user->getId(),
- $utfield => $wgActorTableSchemaMigrationStage <= MIGRATION_WRITE_BOTH ? $user->getName() : '',
- ];
- }
- if ( $wgActorTableSchemaMigrationStage > MIGRATION_OLD ) {
- $ret += [ $acfield => $user->getActorId( $dbw ) ];
- }
- return $ret;
- }
-