Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
base.php
1
<?php
2
3
namespace
Bitrix\Report\VisualConstructor\Internal\Manager
;
4
5
use
Bitrix\Main\Event
;
6
use
Bitrix\Report\VisualConstructor\Config\Common
;
7
use
Bitrix\Report\VisualConstructor\Internal\Error\IErrorable
;
8
13
abstract
class
Base
implements
IErrorable
14
{
15
private
$event;
16
private
static
$instances = array();
17
protected
$errors
;
18
protected
static
$result
;
19
23
protected
abstract
function
getEventTypeKey
();
24
28
abstract
public
function
call
();
29
30
public
function
getErrors
()
31
{
32
return
$this->errors
;
33
}
34
40
public
static
function
getInstance
()
41
{
42
$class = get_called_class();
43
if
(!isset(self::$instances[$class]))
44
{
45
self::$instances[$class] =
new
$class();
46
}
47
return
self::$instances[$class];
48
}
49
54
protected
function
__construct
()
55
{
56
}
57
61
protected
function
getEvent
()
62
{
63
return
$this->event;
64
}
65
72
private
function
__clone()
73
{
74
}
75
79
private
function
collect()
80
{
81
$moduleId = Common::MODULE_NAME;
82
$event =
new
Event($moduleId, $this->
getEventTypeKey
());
83
$event->send();
84
$this->
event
= $event;
85
return
$this;
86
}
87
91
protected
function
getModuleId
()
92
{
93
return
Common::MODULE_NAME;
94
}
95
96
100
protected
function
getResult
()
101
{
102
//TODO: maybe should add here some physical caching ?!!!!!!!!
103
$class = $this->getManagerClassName();
104
if
(!isset($this->result[$class]))
105
{
106
$this->collect();
107
$results = $this->
getEvent
()->getResults();
108
static::$result[$class] = array();
109
foreach
($results as
$result
)
110
{
111
$params =
$result
->getParameters();
112
foreach
($params as $param)
113
{
114
static::$result[$class][] = $param;
115
}
116
}
117
}
118
return
static::$result[$class];
119
}
120
124
private
function
getManagerClassName()
125
{
126
return
get_called_class();
127
}
128
}
Bitrix\Main\Event
Definition
event.php:5
Bitrix\Report\VisualConstructor\Config\Common
Definition
common.php:11
Bitrix\Report\VisualConstructor\Internal\Manager\Base
Definition
base.php:14
Bitrix\Report\VisualConstructor\Internal\Manager\Base\getEvent
getEvent()
Definition
base.php:61
Bitrix\Report\VisualConstructor\Internal\Manager\Base\__construct
__construct()
Definition
base.php:54
Bitrix\Report\VisualConstructor\Internal\Manager\Base\$result
static $result
Definition
base.php:18
Bitrix\Report\VisualConstructor\Internal\Manager\Base\getErrors
getErrors()
Definition
base.php:30
Bitrix\Report\VisualConstructor\Internal\Manager\Base\$errors
$errors
Definition
base.php:17
Bitrix\Report\VisualConstructor\Internal\Manager\Base\getEventTypeKey
getEventTypeKey()
Bitrix\Report\VisualConstructor\Internal\Manager\Base\getModuleId
getModuleId()
Definition
base.php:91
Bitrix\Report\VisualConstructor\Internal\Manager\Base\getInstance
static getInstance()
Definition
base.php:40
Bitrix\Report\VisualConstructor\Internal\Manager\Base\getResult
getResult()
Definition
base.php:100
Bitrix\Report\VisualConstructor\Internal\Manager\Base\call
call()
Bitrix\Report\VisualConstructor\Internal\Error\IErrorable
Definition
ierrorable.php:9
Bitrix\Report\VisualConstructor\Internal\Manager
Definition
analyticboardbatchmanager.php:3
modules
report
lib
visualconstructor
internal
manager
base.php
Создано системой
1.10.0