You are here

public function NodeForm::__construct in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/node/src/NodeForm.php \Drupal\node\NodeForm::__construct()
  2. 10 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 = NULL, TimeInterface $time = NULL, 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;
}