/**
* Adds a related report to the {@link $related_reports} property. If the report
* references the one that is currently being displayed, it will not be added to the related
* report list.
*
* @param string $relatedReport The plugin and method of the report, eg, `'DevicesDetection.getBrowsers'`.
* @param string $title The report's display name, eg, `'Browsers'`.
* @param array $queryParams Any extra query parameters to set in releated report's URL, eg,
* `array('idGoal' => 'ecommerceOrder')`.
*/
public function addRelatedReport($relatedReport, $title, $queryParams = array())
{
list($module, $action) = explode('.', $relatedReport);
// don't add the related report if it references this report
if ($this->controllerName == $module && $this->controllerAction == $action) {
if (empty($queryParams)) {
return;
}
}
$url = ApiRequest::getBaseReportUrl($module, $action, $queryParams);
$this->related_reports[$url] = $title;
}