Chris@0: id() === NULL) { Chris@17: $entity->uid->value = $this->database->nextId($this->database->query('SELECT MAX(uid) FROM {' . $this->getBaseTable() . '}')->fetchField()); Chris@0: $entity->enforceIsNew(); Chris@0: } Chris@0: return parent::doSaveFieldItems($entity, $names); Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: protected function isColumnSerial($table_name, $schema_name) { Chris@0: // User storage does not use a serial column for the user id. Chris@0: return $table_name == $this->revisionTable && $schema_name == $this->revisionKey; Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function updateLastLoginTimestamp(UserInterface $account) { Chris@17: $this->database->update($this->getDataTable()) Chris@0: ->fields(['login' => $account->getLastLoginTime()]) Chris@0: ->condition('uid', $account->id()) Chris@0: ->execute(); Chris@0: // Ensure that the entity cache is cleared. Chris@0: $this->resetCache([$account->id()]); Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function updateLastAccessTimestamp(AccountInterface $account, $timestamp) { Chris@17: $this->database->update($this->getDataTable()) Chris@0: ->fields([ Chris@0: 'access' => $timestamp, Chris@0: ]) Chris@0: ->condition('uid', $account->id()) Chris@0: ->execute(); Chris@0: // Ensure that the entity cache is cleared. Chris@0: $this->resetCache([$account->id()]); Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function deleteRoleReferences(array $rids) { Chris@0: // Remove the role from all users. Chris@0: $this->database->delete('user__roles') Chris@0: ->condition('roles_target_id', $rids) Chris@0: ->execute(); Chris@0: Chris@0: $this->resetCache(); Chris@0: } Chris@0: Chris@0: }