You are here

public function HeartbeatTypeForm::__construct in Heartbeat 8

PHP 5 allows developers to declare constructor methods for classes. Classes which have a constructor method call this method on each newly-created object, so it is suitable for any initialization that the object may need before it is used.

Note: Parent constructors are not called implicitly if the child class defines a constructor. In order to run a parent constructor, a call to parent::__construct() within the child constructor is required.

param [ mixed $args [, $... ]]

Parameters

TreeBuilder $tree_builder:

Renderer $renderer:

Throws

\Exception

File

src/Form/HeartbeatTypeForm.php, line 64

Class

HeartbeatTypeForm
Class HeartbeatTypeForm.

Namespace

Drupal\heartbeat\Form

Code

public function __construct(TreeBuilder $tree_builder, Renderer $renderer, EntityTypeManager $entityTypeManager) {
  $this->treeBuilder = $tree_builder;
  $this->renderer = $renderer;
  $this->entityTypeManager = $entityTypeManager;
  $this->tokenTree = $this->renderer
    ->render($this->treeBuilder
    ->buildAllRenderable([
    'click_insert' => TRUE,
    'show_restricted' => TRUE,
    'show_nested' => FALSE,
  ]));
}