I am trying to programmatically delete an existing view’s display (at the same time as deleting a node) but I am not able to find the good implementation.
HOOK_node_delete(Drupal\Core\Entity\EntityInterface $node) {
//[…]
$view = Views::getView("VIEW_MACHINE_NAME");
$display_name = "block_1";
$views_display = $view->storage->getDisplay($display_name);
//[…]
I can access to the view’s display using the view entity (storage) but as the display has protected access I can’t delete it.
Any help?