You are here

public function ContentModerationNotificationsFormBase::__construct in Content Moderation Notifications 8.2

Same name and namespace in other branches
  1. 8 src/Form/ContentModerationNotificationsFormBase.php \Drupal\content_moderation_notifications\Form\ContentModerationNotificationsFormBase::__construct()

Construct the ContentModerationNotificationFormBase.

For simple entity forms, there's no need for a constructor. Our form base, however, requires an entity query factory to be injected into it from the container. We later use this query factory to build an entity query for the exists() method.

Parameters

\Drupal\Core\Entity\Query\QueryFactory $query_factory: An entity query factory for the entity type.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: An entity type manager for the entity type.

File

src/Form/ContentModerationNotificationsFormBase.php, line 54

Class

ContentModerationNotificationsFormBase
Class ContentModerationNotificationFormBase.

Namespace

Drupal\content_moderation_notifications\Form

Code

public function __construct(QueryFactory $query_factory, EntityTypeManagerInterface $entity_type_manager) {
  $this->entityTypeManager = $entity_type_manager;
  $this->entityQueryFactory = $query_factory;
}