You are here

public function EntityUser::getHighestId in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/user/src/Plugin/migrate/destination/EntityUser.php \Drupal\user\Plugin\migrate\destination\EntityUser::getHighestId()
  2. 9 core/modules/user/src/Plugin/migrate/destination/EntityUser.php \Drupal\user\Plugin\migrate\destination\EntityUser::getHighestId()

Returns the highest ID tracked by the implementing plugin.

Return value

int The highest ID.

Overrides EntityContentBase::getHighestId

File

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

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;
}