Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
reportprovider.php
1<?php
3
4use Bitrix\Report\VisualConstructor\BaseReportHandler;
7
13class ReportProvider extends Base
14{
18 protected function availableFilterKeys()
19 {
20 return array('reportClassName', 'categories', 'unit', 'dataType', 'primary');
21 }
22
26 protected function availableRelations()
27 {
28 return array('category', 'unit');
29 }
30
34 protected function getManagerInstance()
35 {
37 }
38
42 protected function getEntitiesList()
43 {
44 return $this->getManagerInstance()->getReportList();
45 }
46
50 protected function getIndices()
51 {
52 return $this->getManagerInstance()->getIndices();
53 }
54
58 protected function processWithCategory(BaseReport $report)
59 {
60 $categoryProvider = new CategoryProvider();
61 $categoryProvider->addFilter('primary', $report->getCategoryKey());
62 $categoryProvider->execute();
63 $results = $categoryProvider->getResults();
64 $report->category = reset($results);
65 }
66
71 public static function getReportHandlerByClassName($className)
72 {
73 $reportProvider = new ReportProvider();
74 $reportProvider->addFilter('reportClassName', $className);
75 return $reportProvider->execute()->getFirstResult();
76 }
77
78}