You are here

public function Authmap::delete in External Authentication 8

Same name and namespace in other branches
  1. 2.0.x src/Authmap.php \Drupal\externalauth\Authmap::delete()

Delete authmap entries for a given Drupal user ID.

Deletion will be restricted to the specified provider, if passed.

Parameters

int $uid: The Drupal user ID.

string $provider: (optional) The name of the service providing external authentication.

Overrides AuthmapInterface::delete

File

src/Authmap.php, line 125

Class

Authmap
Class Authmap.

Namespace

Drupal\externalauth

Code

public function delete($uid, $provider = NULL) {
  $query = $this->connection
    ->delete('authmap')
    ->condition('uid', $uid);
  if ($provider) {
    $query
      ->condition('provider', $provider);
  }
  $query
    ->execute();
}