system_user_presave

system_user_presave(UserInterface $account)

Implements hook_ENTITY_TYPE_presave() for user entities.

File

core/modules/system/system.module, line 779
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');
  }
}
doc_Drupal
2016-10-29 09:46:01
Comments
Leave a Comment

Please login to continue.