- /**
- * Return user specifications for an UPDATE
- * 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 ) {
- $actorTableSchemaMigrationStage = $this->getConfig()->get( 'ActorTableSchemaMigrationStage' );
-
- $ret = [];
- if ( $actorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_OLD ) {
- $ret += [
- $idfield => $user->getId(),
- $utfield => $user->getName(),
- ];
- }
- if ( $actorTableSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) {
- $ret += [ $acfield => $user->getActorId( $dbw ) ];
- }
- return $ret;
- }
-