You are here

public function EntityHooks::onNodeInsert in Entity Reference Hierarchy 8.2

Same name and namespace in other branches
  1. 3.x 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 89

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);
    }
  }
}