You are here

public static function GdprFieldFilterForm::getFilters in General Data Protection Regulation 8

Same name and namespace in other branches
  1. 8.2 modules/gdpr_fields/src/Form/GdprFieldFilterForm.php \Drupal\gdpr_fields\Form\GdprFieldFilterForm::getFilters()
  2. 3.0.x modules/gdpr_fields/src/Form/GdprFieldFilterForm.php \Drupal\gdpr_fields\Form\GdprFieldFilterForm::getFilters()

Gets gdpr field filters from the request.

Parameters

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

Return value

array The filters keyed by filter name.

2 calls to GdprFieldFilterForm::getFilters()
GDPRController::fieldsList in modules/gdpr_fields/src/Controller/GDPRController.php
Lists all fields with GDPR sensitivity.
GdprFieldFilterForm::buildForm in modules/gdpr_fields/src/Form/GdprFieldFilterForm.php
Form constructor.

File

modules/gdpr_fields/src/Form/GdprFieldFilterForm.php, line 156

Class

GdprFieldFilterForm
Filter form for GDPR field list page.

Namespace

Drupal\gdpr_fields\Form

Code

public static function getFilters(Request $request) {
  $filters = [
    'search' => $request
      ->get('search'),
    'entity_type' => $request
      ->get('entity_type'),
    'rta' => $request
      ->get('rta'),
    'rtf' => $request
      ->get('rtf'),
    'empty' => $request
      ->get('empty'),
  ];
  if ($filters['rtf'] === NULL) {
    $filters['rtf'] = [];
  }
  if ($filters['rta'] === NULL) {
    $filters['rta'] = [];
  }
  return $filters;
}