You are here

private function MatomoReportsController::getPeriodName in Matomo Reports 8

Helper function to return the name of the selected period.

Parameters

int $period: Selected period.

Return value

string Name of period.

1 call to MatomoReportsController::getPeriodName()
MatomoReportsController::reports in src/Controller/MatomoReportsController.php
Reports.

File

src/Controller/MatomoReportsController.php, line 382

Class

MatomoReportsController
Class MatomoReportsController.

Namespace

Drupal\matomo_reports\Controller

Code

private function getPeriodName($period) {

  // Possible periods are day, week, month, year.
  switch ($period) {
    case 0:
      $p = "day";
      break;
    case 1:
      $p = "day";
      break;
    case 2:
      $p = "week";
      break;
    case 3:
      $p = "month";
      break;
    case 4:
      $p = "year";
      break;
  }
  return $p;
}