You are here

public function WorkspaceDeleteForm::__construct in Workspace 8

WorkspaceDeleteForm constructor.

Parameters

\Drupal\multiversion\Workspace\WorkspaceManagerInterface $workspace_manager:

\Drupal\Core\Entity\EntityTypeBundleInfoInterface $default_workspace_id:

\Drupal\Core\Entity\EntityManagerInterface $entity_manager:

\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository:

\Drupal\Core\Entity\EntityTypeBundleInfoInterface|null $entity_type_bundle_info:

\Drupal\Component\Datetime\TimeInterface|null $time:

Overrides ContentEntityForm::__construct

File

src/Entity/Form/WorkspaceDeleteForm.php, line 45

Class

WorkspaceDeleteForm
Provides a confirmation form for deleting a workspace entity.

Namespace

Drupal\workspace\Entity\Form

Code

public function __construct(WorkspaceManagerInterface $workspace_manager, $default_workspace_id, EntityManagerInterface $entity_manager, EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL) {
  if (floatval(\Drupal::VERSION) >= 8.6) {
    parent::__construct($entity_repository, $entity_type_bundle_info, $time);
  }
  else {
    parent::__construct($entity_manager, $entity_type_bundle_info, $time);
  }
  $this->workspaceManager = $workspace_manager;
  $this->defaultWorkspace = Workspace::load($default_workspace_id);
}