You are here

public function MongodbUserData::delete in MongoDB 8

Deletes data stored for a user account.

Parameters

string|array $module: (optional) The name of the module the data is associated with. Can also be an array to delete the data of multiple modules.

integer|array $uid: (optional) The user account ID the data is associated with. If omitted, all data for $module is deleted. Can also be an array of IDs to delete the data of multiple user accounts.

string $name: (optional) The name of the data key. If omitted, all data associated with $module and $uid is deleted.

Return value

void

Overrides UserDataInterface::delete

File

mongodb_user/src/MongodbUserData.php, line 107
Contains \Drupal\mongodb_user\MongodbUserData.

Class

MongodbUserData

Namespace

Drupal\mongodb_user

Code

public function delete($module = NULL, $uid = NULL, $name = NULL) {
  if ($query = $this
    ->getQuery(func_get_args())) {
    $this->mongo
      ->get('user_data')
      ->remove($query);
  }
}