protected function EntityHandlerBase::deleteEntity in CMS Content Sync 8
Same name and namespace in other branches
- 2.1.x src/Plugin/EntityHandlerBase.php \Drupal\cms_content_sync\Plugin\EntityHandlerBase::deleteEntity()
- 2.0.x src/Plugin/EntityHandlerBase.php \Drupal\cms_content_sync\Plugin\EntityHandlerBase::deleteEntity()
Delete a entity.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity to delete
Return value
bool Returns TRUE or FALSE for the deletion process
Throws
\Drupal\cms_content_sync\Exception\SyncException
2 calls to EntityHandlerBase::deleteEntity()
- DefaultTaxonomyHandler::pull in src/
Plugin/ cms_content_sync/ entity_handler/ DefaultTaxonomyHandler.php - Pull the remote entity.
- EntityHandlerBase::pull in src/
Plugin/ EntityHandlerBase.php - Pull the remote entity.
File
- src/
Plugin/ EntityHandlerBase.php, line 468
Class
- EntityHandlerBase
- Common base class for entity handler plugins.
Namespace
Drupal\cms_content_sync\PluginCode
protected function deleteEntity(EntityInterface $entity) {
try {
$entity
->delete();
} catch (\Exception $e) {
throw new SyncException(SyncException::CODE_ENTITY_API_FAILURE, $e);
}
return true;
}