Piwik\Plugins\Events\Events::getColumnTranslation PHP Method

getColumnTranslation() public method

Given getCategory, returns "Event Category"
public getColumnTranslation ( $apiMethod ) : string
$apiMethod
return string
    public function getColumnTranslation($apiMethod)
    {
        return $this->getTranslation($apiMethod, $index = 1);
    }

Usage Example

Esempio n. 1
0
 public function configureView(ViewDataTable $view)
 {
     if ($view->requestConfig->getApiModuleToRequest() != 'Events') {
         return;
     }
     // eg. 'Events.getCategory'
     $apiMethod = $view->requestConfig->getApiMethodToRequest();
     $events = new Events();
     $secondaryDimension = $events->getSecondaryDimensionFromRequest();
     $view->config->subtable_controller_action = API::getInstance()->getActionToLoadSubtables($apiMethod, $secondaryDimension);
     $view->config->columns_to_display = array('label', 'nb_events', 'sum_event_value');
     $view->config->show_flatten_table = true;
     $view->config->show_table_all_columns = false;
     $view->requestConfig->filter_sort_column = 'nb_events';
     $labelTranslation = $events->getColumnTranslation($apiMethod);
     $view->config->addTranslation('label', $labelTranslation);
     $view->config->addTranslations($events->getMetricTranslations());
     $this->addRelatedReports($view, $secondaryDimension);
     $this->addTooltipEventValue($view);
 }