- if ( $userId ) {
- $this->addWhereFld( 'img_user', $userId );
- } else {
- $this->addWhereFld( 'img_user_text', $params['user'] );
- }
+ $actorQuery = ActorMigration::newMigration()
+ ->getWhere( $db, 'img_user', User::newFromName( $params['user'], false ) );
+ $this->addTables( $actorQuery['tables'] );
+ $this->addJoinConds( $actorQuery['joins'] );
+ $this->addWhere( $actorQuery['conds'] );