function EntityUser::getHighestId

Same name in other branches
  1. 9 core/modules/user/src/Plugin/migrate/destination/EntityUser.php \Drupal\user\Plugin\migrate\destination\EntityUser::getHighestId()
  2. 10 core/modules/user/src/Plugin/migrate/destination/EntityUser.php \Drupal\user\Plugin\migrate\destination\EntityUser::getHighestId()
  3. 11.x core/modules/user/src/Plugin/migrate/destination/EntityUser.php \Drupal\user\Plugin\migrate\destination\EntityUser::getHighestId()

Overrides EntityContentBase::getHighestId

File

core/modules/user/src/Plugin/migrate/destination/EntityUser.php, line 179

Class

EntityUser
Provides a destination plugin for migrating user entities.

Namespace

Drupal\user\Plugin\migrate\destination

Code

public function getHighestId() {
    $highest_id = parent::getHighestId();
    // Every Drupal site must have a user with UID of 1 and it's normal for
    // migrations to overwrite this user.
    if ($highest_id === 1) {
        return 0;
    }
    return $highest_id;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.