Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
resultview.php
1
<?php
8
namespace
Bitrix\Sender\Connector
;
9
10
use
Bitrix\Main\ArgumentException
;
11
use
Bitrix\Sender\UI\PageNavigation
;
12
18
Class ResultView
19
{
20
const
Title =
'title'
;
21
const
Draw
=
'draw'
;
22
const
Filter =
'filter'
;
23
const
FilterModifier
=
'filter-modifier'
;
24
const
ColumnModifier
=
'column-modifier'
;
25
27
protected
$connector
;
28
30
protected
$callbacks
;
31
33
protected
$nav
;
34
40
public
function
__construct
(
Base
$connector
)
41
{
42
$this->connector =
$connector
;
43
}
44
53
public
function
setCallback
($name, $callable)
54
{
55
if
(!is_callable($callable))
56
{
57
throw
new
ArgumentException
(
'Parameter \'callable\' should be callable.'
);
58
}
59
60
$this->callbacks[$name] = $callable;
61
62
return
$this;
63
}
64
65
protected
function
runCallback
($name, array $arguments = [])
66
{
67
if
(!isset($this->callbacks[$name]))
68
{
69
return
null
;
70
}
71
72
return
call_user_func_array($this->callbacks[$name], $arguments);
73
}
74
80
public
function
getTitle
()
81
{
82
return
$this->
runCallback
(self::Title) ?: $this->connector->getName();
83
}
84
91
public
function
modifyFilter
(array &$filter)
92
{
93
$this->
runCallback
(self::FilterModifier, [&$filter]);
94
}
95
102
public
function
modifyColumns
(array &$columns)
103
{
104
$this->
runCallback
(self::ColumnModifier, [&$columns]);
105
}
106
113
public
function
setNav
(
PageNavigation
$nav
=
null
)
114
{
115
$this->nav =
$nav
;
116
return
$this;
117
}
118
124
public
function
getNav
()
125
{
126
return
$this->nav
;
127
}
128
134
public
function
hasNav
()
135
{
136
return
!empty($this->nav);
137
}
138
144
public
function
onFilter
()
145
{
146
$this->
runCallback
(self::Filter);
147
}
148
155
public
function
onDraw
(array &$raw)
156
{
157
$this->
runCallback
(self::Draw, [&$raw]);
158
}
159
}
Bitrix\Main\ArgumentException
Definition
exception.php:34
Bitrix\Main\UI\PageNavigation
Definition
pagenavigation.php:27
Bitrix\Sender\Connector\Base
Definition
base.php:13
Bitrix\Sender\Connector
Definition
base.php:8
Bitrix\Sender\Connector\onDraw
onDraw(array &$raw)
Definition
resultview.php:155
Bitrix\Sender\Connector\$callbacks
$callbacks
Definition
resultview.php:30
Bitrix\Sender\Connector\Draw
const Draw
Definition
resultview.php:21
Bitrix\Sender\Connector\modifyFilter
modifyFilter(array &$filter)
Definition
resultview.php:91
Bitrix\Sender\Connector\__construct
__construct(Base $connector)
Definition
resultview.php:40
Bitrix\Sender\Connector\ColumnModifier
const ColumnModifier
Definition
resultview.php:24
Bitrix\Sender\Connector\FilterModifier
const FilterModifier
Definition
resultview.php:23
Bitrix\Sender\Connector\$connector
$connector
Definition
resultview.php:27
Bitrix\Sender\Connector\getNav
getNav()
Definition
resultview.php:124
Bitrix\Sender\Connector\setCallback
setCallback($name, $callable)
Definition
resultview.php:53
Bitrix\Sender\Connector\getTitle
getTitle()
Definition
resultview.php:80
Bitrix\Sender\Connector\hasNav
hasNav()
Definition
resultview.php:134
Bitrix\Sender\Connector\setNav
setNav(PageNavigation $nav=null)
Definition
resultview.php:113
Bitrix\Sender\Connector\runCallback
runCallback($name, array $arguments=[])
Definition
resultview.php:65
Bitrix\Sender\Connector\$nav
$nav
Definition
resultview.php:33
Bitrix\Sender\Connector\modifyColumns
modifyColumns(array &$columns)
Definition
resultview.php:102
Bitrix\Sender\Connector\onFilter
onFilter()
Definition
resultview.php:144
modules
sender
lib
connector
resultview.php
Создано системой
1.10.0