UserUpdate8002.php in Drupal 10
File
core/modules/user/src/Plugin/migrate/process/UserUpdate8002.php
View source
<?php
namespace Drupal\user\Plugin\migrate\process;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;
class UserUpdate8002 extends ProcessPluginBase {
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
$rid = $row
->getSourceProperty('rid');
$map = [
1 => 'anonymous',
2 => 'authenticated',
];
return $map[$rid] ?? $value;
}
}