You are here

public function NodeRevisionDelete::getTimeValues in Node Revision Delete 8

Return the available values for time frequency.

Parameters

string $index: The index to retrieve.

Return value

string|array The index value (human readable value).

Overrides NodeRevisionDeleteInterface::getTimeValues

File

src/NodeRevisionDelete.php, line 214

Class

NodeRevisionDelete
Class NodeRevisionDelete.

Namespace

Drupal\node_revision_delete

Code

public function getTimeValues($index = NULL) {
  $options_node_revision_delete_time = [
    '-1' => $this
      ->t('Never'),
    '0' => $this
      ->t('Every time cron runs'),
    '3600' => $this
      ->t('Every hour'),
    '86400' => $this
      ->t('Everyday'),
    '604800' => $this
      ->t('Every week'),
    '864000' => $this
      ->t('Every 10 days'),
    '1296000' => $this
      ->t('Every 15 days'),
    '2592000' => $this
      ->t('Every month'),
    '7776000' => $this
      ->t('Every 3 months'),
    '15552000' => $this
      ->t('Every 6 months'),
    '31536000' => $this
      ->t('Every year'),
    '63072000' => $this
      ->t('Every 2 years'),
  ];
  if (isset($index) && isset($options_node_revision_delete_time[$index])) {
    return $options_node_revision_delete_time[$index];
  }
  else {
    return $options_node_revision_delete_time;
  }
}