EntityTestUpdateStorage.php in Drupal 9
File
core/modules/system/tests/modules/entity_test_update/src/EntityTestUpdateStorage.php
View source
<?php
namespace Drupal\entity_test_update;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
class EntityTestUpdateStorage extends SqlContentEntityStorage {
protected function saveToDedicatedTables(ContentEntityInterface $entity, $update = TRUE, $names = []) {
if (\Drupal::state()
->get('entity_test_update.throw_exception', FALSE)) {
throw new \Exception('Peekaboo!');
}
parent::saveToDedicatedTables($entity, $update, $names);
}
}