1 user.entity.inc public UserStorageController::save(EntityInterface $entity)

Overrides EntityDatabaseStorageController::save().

Parameters

User $entity: The user entity to be saved.

Overrides EntityDatabaseStorageController::save

File

core/modules/user/user.entity.inc, line 348
Entity classes and controllers for User module.

Class

UserStorageController
Controller class for users.

Code

public function save(EntityInterface $entity) {
  if (empty($entity->uid)) {
    $entity->uid = db_next_id(db_query('SELECT MAX(uid) FROM {users}')->fetchField());
    $entity->is_new = TRUE;
  }
  return parent::save($entity);
}