You are here

public function DataPolicyAddForm::__construct in Data Policy 8

DataPolicyAddForm constructor.

Parameters

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

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

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

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.

\Symfony\Component\HttpFoundation\Request $request: The current request.

Overrides ContentEntityForm::__construct

File

src/Form/DataPolicyAddForm.php, line 63

Class

DataPolicyAddForm
Class DataPolicyAddForm.

Namespace

Drupal\data_policy\Form

Code

public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, TimeInterface $time, RouteMatchInterface $route_match, Request $request) {
  parent::__construct($entity_repository, $entity_type_bundle_info, $time);
  $this->routeMatch = $route_match;
  $this->request = $request;
  $this->routeName = $this->routeMatch
    ->getRouteName();
  $this->entityId = $this->request
    ->get('entity_id');
}