You are here

private function TaskActionsForm::doRemoval in General Data Protection Regulation 3.0.x

Same name and namespace in other branches
  1. 8.2 modules/gdpr_tasks/src/Form/TaskActionsForm.php \Drupal\gdpr_tasks\Form\TaskActionsForm::doRemoval()
  2. 8 modules/gdpr_tasks/src/Form/TaskActionsForm.php \Drupal\gdpr_tasks\Form\TaskActionsForm::doRemoval()

Performs the removal request.

Return value

array Errors array.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

\Drupal\Core\TypedData\Exception\ReadOnlyException

1 call to TaskActionsForm::doRemoval()
TaskActionsForm::save in modules/gdpr_tasks/src/Form/TaskActionsForm.php
Form submission handler for the 'save' action.

File

modules/gdpr_tasks/src/Form/TaskActionsForm.php, line 135

Class

TaskActionsForm
Form controller for Task edit forms.

Namespace

Drupal\gdpr_tasks\Form

Code

private function doRemoval() {

  /** @var \Drupal\gdpr_tasks\Entity\Task $entity */
  $entity = $this->entity;
  $email = $entity
    ->getOwner()
    ->getEmail();
  $errors = $this->anonymizer
    ->run($entity);
  if (count($errors) === 0) {
    $this->eventDispatcher
      ->dispatch(RightToBeForgottenCompleteEvent::EVENT_NAME, new RightToBeForgottenCompleteEvent($email));
  }
  return $errors;
}