class NodeTestExceptionHooks

Hook implementations for node_test_exception.

Hierarchy

Expanded class hierarchy of NodeTestExceptionHooks

File

core/modules/node/tests/modules/node_test_exception/src/Hook/NodeTestExceptionHooks.php, line 13

Namespace

Drupal\node_test_exception\Hook
View source
class NodeTestExceptionHooks {
  
  /**
   * Implements hook_ENTITY_TYPE_insert() for node entities.
   */
  public function nodeInsert(NodeInterface $node) : void {
    if ($node->getTitle() == 'testing_transaction_exception') {
      throw new \Exception('Test exception for rollback.');
    }
  }

}

Members

Title Sort descending Modifiers Object type Summary
NodeTestExceptionHooks::nodeInsert public function Implements hook_ENTITY_TYPE_insert() for node entities.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.