You are here

function system_user_presave in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/system.module \system_user_presave()

Implements hook_ENTITY_TYPE_presave() for user entities.

File

core/modules/system/system.module, line 746
Configuration system that lets administrators modify the workings of the site.

Code

function system_user_presave(UserInterface $account) {
  $config = \Drupal::config('system.date');
  if ($config
    ->get('timezone.user.configurable') && !$account
    ->getTimeZone() && !$config
    ->get('timezone.user.default')) {
    $account->timezone = $config
      ->get('timezone.default');
  }
}