You are here

public function EntityHooks::onNodeInsert in Entity Reference Hierarchy 3.x

Same name and namespace in other branches
  1. 8.2 modules/entity_hierarchy_microsite/src/EntityHooks.php \Drupal\entity_hierarchy_microsite\EntityHooks::onNodeInsert()

React to node insert.

Parameters

\Drupal\node\NodeInterface $node: Node.

File

modules/entity_hierarchy_microsite/src/EntityHooks.php, line 103

Class

EntityHooks
Defines a class for entity hooks for the module.

Namespace

Drupal\entity_hierarchy_microsite

Code

public function onNodeInsert(NodeInterface $node) {
  foreach ($this->parentCandidate
    ->getCandidateFields($node) as $field) {
    foreach ($this
      ->getMicrositesForNodeAndField($node, $field) as $microsite) {
      $this
        ->updateMenuForMicrosite($microsite);
    }
  }
}