Piwik\Plugins\Goals\Visualizations\Goals::setPropertiesForGoals PHP Method

setPropertiesForGoals() private method

private setPropertiesForGoals ( $idSite, $idGoals )
    private function setPropertiesForGoals($idSite, $idGoals)
    {
        $allGoals = $this->getGoals($idSite);
        if ('all' == $idGoals) {
            $idGoals = array_keys($allGoals);
        } else {
            // only sort by a goal's conversions if not showing all goals (for FULL_REPORT)
            $this->requestConfig->filter_sort_column = 'goal_' . reset($idGoals) . '_nb_conversions';
            $this->requestConfig->filter_sort_order = 'desc';
        }
        $this->config->columns_to_display = array('label', 'nb_visits');
        $goalColumnTemplates = array('goal_%s_nb_conversions', 'goal_%s_conversion_rate', 'goal_%s_revenue', 'goal_%s_revenue_per_visit');
        // set columns to display (columns of same type but different goals will be next to each other,
        // ie, goal_0_nb_conversions, goal_1_nb_conversions, etc.)
        foreach ($goalColumnTemplates as $columnTemplate) {
            foreach ($idGoals as $idGoal) {
                $this->config->columns_to_display[] = sprintf($columnTemplate, $idGoal);
            }
        }
        $this->config->columns_to_display[] = 'revenue_per_visit';
    }