You are here

public function ContentModerationNotificationsFormBase::__construct in Content Moderation Notifications 8

Same name and namespace in other branches
  1. 8.2 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 content_moderation_notification 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 content_moderation_notification entity type.

File

src/Form/ContentModerationNotificationsFormBase.php, line 50

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;
}