You are here

public function MongodbPathAliasStorage::delete in MongoDB 8

Deletes a URL alias.

The default implementation performs case-insensitive matching on the 'source' and 'alias' strings.

Parameters

array $conditions: An array of criteria.

Overrides AliasStorageInterface::delete

File

src/MongodbPathAliasStorage.php, line 109
Contains Drupal\mongodb\Path.

Class

MongodbPathAliasStorage
Provides a class for CRUD operations on path aliases in MongoDB.

Namespace

Drupal\mongodb

Code

public function delete($conditions) {
  $path = $this
    ->load($conditions);

  // Code in core assumes the id is called "pid", not "_id".
  if (isset($conditions['pid'])) {
    $conditions['_id'] = $conditions['pid'];
    unset($conditions['pid']);
  }
  $response = $this
    ->mongoCollection()
    ->remove($conditions);
  $this->module_handler
    ->invokeAll('path_delete', $path);
  return $response['n'];
}