private function TaskActionsForm::doRemoval in General Data Protection Regulation 8
Same name and namespace in other branches
- 8.2 modules/gdpr_tasks/src/Form/TaskActionsForm.php \Drupal\gdpr_tasks\Form\TaskActionsForm::doRemoval()
- 3.0.x modules/gdpr_tasks/src/Form/TaskActionsForm.php \Drupal\gdpr_tasks\Form\TaskActionsForm::doRemoval()
Performs the removal request.
Parameters
\Drupal\Core\Form\FormStateInterface $form_state: The form state.
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 127
Class
- TaskActionsForm
- Form controller for Task edit forms.
Namespace
Drupal\gdpr_tasks\FormCode
private function doRemoval(FormStateInterface $form_state) {
/* @var $entity \Drupal\gdpr_tasks\Entity\Task */
$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;
}