view core/modules/node/tests/modules/node_test_exception/node_test_exception.module @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
line wrap: on
line source
<?php

/**
 * @file
 * A module implementing node related hooks to test API interaction.
 */

use Drupal\node\NodeInterface;

/**
 * Implements hook_ENTITY_TYPE_insert() for node entities.
 */
function node_test_exception_node_insert(NodeInterface $node) {
  if ($node->getTitle() == 'testing_transaction_exception') {
    throw new Exception('Test exception for rollback.');
  }
}