public function AliasStorage::delete in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Path/AliasStorage.php \Drupal\Core\Path\AliasStorage::delete()
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
- core/
lib/ Drupal/ Core/ Path/ AliasStorage.php, line 125 - Contains \Drupal\Core\Path\AliasStorage.
Class
- AliasStorage
- Provides a class for CRUD operations on path aliases.
Namespace
Drupal\Core\PathCode
public function delete($conditions) {
$path = $this
->load($conditions);
$query = $this->connection
->delete('url_alias');
foreach ($conditions as $field => $value) {
if ($field == 'source' || $field == 'alias') {
// Use LIKE for case-insensitive matching.
$query
->condition($field, $this->connection
->escapeLike($value), 'LIKE');
}
else {
$query
->condition($field, $value);
}
}
$deleted = $query
->execute();
// @todo Switch to using an event for this instead of a hook.
$this->moduleHandler
->invokeAll('path_delete', array(
$path,
));
Cache::invalidateTags([
'route_match',
]);
return $deleted;
}