29 $this->errors[] =
new Error(
"Set view to get data");
34 $this->errors[] =
new Error(
"Set report to get data");
38 $compatibleDataType = $this->
getView()->getCompatibleDataType();
41 if(!isset(Common::$reportImplementationTypesMap[$compatibleDataType]))
43 $this->errors[] =
new Error(
"No isset : '" . $compatibleDataType .
"' compatible data type.'");
48 $reportHandler = $this->
getReport()->getReportHandler();
49 if (!$reportHandler->isEnabled())
54 $reportHandler->setView($this->
getView());
55 if ($reportHandler instanceof Common::$reportImplementationTypesMap[$compatibleDataType][
'interface'])
57 if (!Dashboard::getBoardModeIsDemo($this->
getReport()->getWidget()->getBoardId()))
59 $reportHandler->setCalculatedData($reportHandler->prepare());
60 $getDataMethodName = Common::$reportImplementationTypesMap[$compatibleDataType][
'method'];
61 $result = $reportHandler->{$getDataMethodName}();
65 $getDemoDataMethodName = Common::$reportImplementationTypesMap[$compatibleDataType][
'demoMethod'];
66 $result = $reportHandler->{$getDemoDataMethodName}();
69 elseif ($reportHandler::getClassName() === BaseReport::getClassName())
71 $getDataMethodName = Common::$reportImplementationTypesMap[$compatibleDataType][
'method'];
72 if (method_exists($reportHandler, $getDataMethodName))
74 $result = $reportHandler->{$getDataMethodName}();
84 $this->errors[] =
new Error(
'Report handler ' . $reportHandler::getClassName() .
' does not implement a compatible interface');