You are here

function entity_hierarchy_views_node_builder in Entity Reference Hierarchy 8

Entity form builder adds the hierarchy information to the node object. More officially, this builds an updated entity object based upon the submitted form values.

This function is called from the #entity_builders callback.

As per https://www.drupal.org/node/2420295, an entity field may be better suited to this task.

See also

entity_hierarchy_views_form_node_form_alter

EntityForm::buildEntity

\Drupal\Core\Entity\ContentEntityBase

core/lib/Drupal/Core/Entity/ContentEntityBase.php

1 string reference to 'entity_hierarchy_views_node_builder'
entity_hierarchy_views_form_node_form_alter in entity_hierarchy_views/entity_hierarchy_views.module
@todo Please document this function.

File

entity_hierarchy_views/entity_hierarchy_views.module, line 160
Contains entity_hierarchy_views.module..

Code

function entity_hierarchy_views_node_builder($entity_type, NodeInterface $node, &$form, FormStateInterface $form_state) {
  $node->nh_children_view = $form_state
    ->getValue('nh_children_view');
}