You are here

public function BlazyAdminBase::getCacheOptions in Blazy 8

Same name and namespace in other branches
  1. 8.2 src/Form/BlazyAdminBase.php \Drupal\blazy\Form\BlazyAdminBase::getCacheOptions()
  2. 7 src/Form/BlazyAdminBase.php \Drupal\blazy\Form\BlazyAdminBase::getCacheOptions()

Returns time in interval for select options.

1 call to BlazyAdminBase::getCacheOptions()
BlazyAdminExtended::closingForm in src/Dejavu/BlazyAdminExtended.php
Returns shared ending form elements across field formatter and Views.

File

src/Form/BlazyAdminBase.php, line 671

Class

BlazyAdminBase
A base for blazy admin integration to have re-usable methods in one place.

Namespace

Drupal\blazy\Form

Code

public function getCacheOptions() {
  $period = [
    0,
    60,
    180,
    300,
    600,
    900,
    1800,
    2700,
    3600,
    10800,
    21600,
    32400,
    43200,
    86400,
  ];
  $period = array_map([
    \Drupal::service('date.formatter'),
    'formatInterval',
  ], array_combine($period, $period));
  $period[0] = '<' . $this
    ->t('No caching') . '>';
  return $period + [
    Cache::PERMANENT => $this
      ->t('Permanent'),
  ];
}