function NodeForm::__construct

Same name in other branches
  1. 9 core/modules/node/src/NodeForm.php \Drupal\node\NodeForm::__construct()
  2. 8.9.x core/modules/node/src/NodeForm.php \Drupal\node\NodeForm::__construct()
  3. 11.x core/modules/node/src/NodeForm.php \Drupal\node\NodeForm::__construct()

Constructs a NodeForm object.

Parameters

\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository: The entity repository.

\Drupal\Core\TempStore\PrivateTempStoreFactory $temp_store_factory: The factory for the temp store object.

\Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info: The entity type bundle service.

\Drupal\Component\Datetime\TimeInterface $time: The time service.

\Drupal\Core\Session\AccountInterface $current_user: The current user.

\Drupal\Core\Datetime\DateFormatterInterface $date_formatter: The date formatter service.

Overrides ContentEntityForm::__construct

File

core/modules/node/src/NodeForm.php, line 59

Class

NodeForm
Form handler for the node edit forms.

Namespace

Drupal\node

Code

public function __construct(EntityRepositoryInterface $entity_repository, PrivateTempStoreFactory $temp_store_factory, EntityTypeBundleInfoInterface $entity_type_bundle_info, TimeInterface $time, AccountInterface $current_user, DateFormatterInterface $date_formatter) {
    parent::__construct($entity_repository, $entity_type_bundle_info, $time);
    $this->tempStoreFactory = $temp_store_factory;
    $this->currentUser = $current_user;
    $this->dateFormatter = $date_formatter;
}

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