public function PathItem::delete in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/path/src/Plugin/Field/FieldType/PathItem.php \Drupal\path\Plugin\Field\FieldType\PathItem::delete()
Defines custom delete behavior for field values.
This method is called during the process of deleting an entity, just before values are deleted from storage.
Overrides FieldItemBase::delete
File
- core/
modules/ path/ src/ Plugin/ Field/ FieldType/ PathItem.php, line 83 - Contains \Drupal\path\Plugin\Field\FieldType\PathItem.
Class
- PathItem
- Defines the 'path' entity field type.
Namespace
Drupal\path\Plugin\Field\FieldTypeCode
public function delete() {
// Delete all aliases associated with this entity.
$entity = $this
->getEntity();
\Drupal::service('path.alias_storage')
->delete(array(
'source' => '/' . $entity
->urlInfo()
->getInternalPath(),
));
}