You are here

public function ThunderNodeForm::__construct in Thunder 8.3

Same name and namespace in other branches
  1. 8.5 modules/thunder_article/src/Form/ThunderNodeForm.php \Drupal\thunder_article\Form\ThunderNodeForm::__construct()
  2. 8.2 modules/thunder_article/src/Form/ThunderNodeForm.php \Drupal\thunder_article\Form\ThunderNodeForm::__construct()
  3. 8.4 modules/thunder_article/src/Form/ThunderNodeForm.php \Drupal\thunder_article\Form\ThunderNodeForm::__construct()
  4. 6.2.x modules/thunder_article/src/Form/ThunderNodeForm.php \Drupal\thunder_article\Form\ThunderNodeForm::__construct()
  5. 6.0.x modules/thunder_article/src/Form/ThunderNodeForm.php \Drupal\thunder_article\Form\ThunderNodeForm::__construct()
  6. 6.1.x modules/thunder_article/src/Form/ThunderNodeForm.php \Drupal\thunder_article\Form\ThunderNodeForm::__construct()

Constructs a NodeForm object.

Parameters

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

\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger service.

\Symfony\Component\HttpFoundation\RequestStack $requestStack: The request stack service.

\Drupal\node\Access\NodeRevisionAccessCheck $node_revision_access: The node revision access check service.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\content_moderation\ModerationInformationInterface $moderationInfo: (optional) The moderation info service. The optionality is important otherwise this form becomes dependent on the content_moderation module.

File

modules/thunder_article/src/Form/ThunderNodeForm.php, line 83

Class

ThunderNodeForm
Base for handler for node add/edit forms.

Namespace

Drupal\thunder_article\Form

Code

public function __construct(AccountInterface $current_user, MessengerInterface $messenger, RequestStack $requestStack, NodeRevisionAccessCheck $node_revision_access, EntityTypeManagerInterface $entity_type_manager, ModerationInformationInterface $moderationInfo = NULL) {
  $this->currentUser = $current_user;
  $this->messenger = $messenger;
  $this->request = $requestStack
    ->getCurrentRequest();
  $this->nodeRevisionAccess = $node_revision_access;
  $this->entityTypeManager = $entity_type_manager;
  $this->moderationInfo = $moderationInfo;
}