Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EntityUser.php

function EntityUser::getHighestId

Overrides EntityContentBase::getHighestId

File

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

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal