// The anonymous user account is saved with the fixed user ID of 0.
// Therefore we need to check for NULL explicitly.
if ($entity->id() === NULL) {
- $entity->uid->value = $this->database->nextId($this->database->query('SELECT MAX(uid) FROM {users}')->fetchField());
+ $entity->uid->value = $this->database->nextId($this->database->query('SELECT MAX(uid) FROM {' . $this->getBaseTable() . '}')->fetchField());
$entity->enforceIsNew();
}
return parent::doSaveFieldItems($entity, $names);
* {@inheritdoc}
*/
public function updateLastLoginTimestamp(UserInterface $account) {
- $this->database->update('users_field_data')
+ $this->database->update($this->getDataTable())
->fields(['login' => $account->getLastLoginTime()])
->condition('uid', $account->id())
->execute();
* {@inheritdoc}
*/
public function updateLastAccessTimestamp(AccountInterface $account, $timestamp) {
- $this->database->update('users_field_data')
+ $this->database->update($this->getDataTable())
->fields([
'access' => $timestamp,
])