function UserUpdate7002::transform
Overrides ProcessPluginBase::transform
File
-
core/
modules/ user/ src/ Plugin/ migrate/ process/ d6/ UserUpdate7002.php, line 60
Class
- UserUpdate7002
- Converts user time zones from time zone offsets to time zone names.
Namespace
Drupal\user\Plugin\migrate\process\d6Code
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
$timezone = $row->getSourceProperty('timezone_name') ?? $row->getSourceProperty('event_timezone');
if ($timezone === NULL || !isset(static::$timezones[$timezone])) {
$timezone = $this->dateConfig
->get('timezone.default');
}
return $timezone;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.