You are here

public function ExportDataPolicy::getStateName in Data Policy 8

Helper function to return the human-friendly name to the CSV export.

Parameters

int $state_id: The ID of the state for which we want to get the text.

Return value

mixed The text we will be using in the export.

1 call to ExportDataPolicy::getStateName()
ExportDataPolicy::executeMultiple in modules/data_policy_export/src/Plugin/Action/ExportDataPolicy.php

File

modules/data_policy_export/src/Plugin/Action/ExportDataPolicy.php, line 187

Class

ExportDataPolicy
Exports data policies to CSV.

Namespace

Drupal\data_policy_export\Plugin\Action

Code

public function getStateName($state_id) {
  $options = [
    UserConsentInterface::STATE_UNDECIDED => t('Undecided'),
    UserConsentInterface::STATE_NOT_AGREE => t('Not agree'),
    UserConsentInterface::STATE_AGREE => t('Agree'),
  ];
  return $options[$state_id];
}