1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
union.php
См. документацию.
1
<?php
8
9
namespace
Bitrix\Main\ORM\Query;
10
use Bitrix\Main\ArgumentException;
11
use Bitrix\Main\DB\Connection;
12
19
class
Union
20
{
22
protected
$queries
;
23
25
protected
$order
;
26
28
protected
$limit
;
29
31
protected
$offset
;
32
34
protected
$connection
;
35
36
public
function
__construct
(
Connection
$connection
)
37
{
38
$this->connection =
$connection
;
39
}
40
46
public
function
addQuery
(
UnionCondition
$query
)
47
{
48
$this->queries[] =
$query
;
49
return
$this;
50
}
51
55
public
function
getQueries
()
56
{
57
return
$this->queries
;
58
}
59
65
public
function
setOrder
(
$order
)
66
{
67
$this->order =
array
();
68
69
if
(!is_array(
$order
))
70
{
71
$order
=
array
(
$order
);
72
}
73
74
foreach
(
$order
as
$k
=> $v)
75
{
76
if
(is_numeric(
$k
))
77
{
78
$this->
addOrder
($v);
79
}
80
else
81
{
82
$this->
addOrder
(
$k
, $v);
83
}
84
}
85
86
return
$this;
87
}
88
96
public
function
addOrder
($definition,
$order
=
'ASC'
)
97
{
98
$order
= strtoupper(
$order
);
99
100
if
(!in_array(
$order
,
array
(
'ASC'
,
'DESC'
),
true
))
101
{
102
throw
new
ArgumentException
(sprintf(
'Invalid order "%s"'
,
$order
));
103
}
104
105
$helper = $this->connection->getSqlHelper();
106
107
if
(
$order
==
'ASC'
)
108
{
109
$order
= $helper->getAscendingOrder();
110
}
111
else
112
{
113
$order
= $helper->getDescendingOrder();
114
}
115
116
$this->order[$definition] =
$order
;
117
118
return
$this;
119
}
120
124
public
function
getOrder
()
125
{
126
return
$this->order
;
127
}
128
134
public
function
setLimit
(
$limit
)
135
{
136
$this->limit =
$limit
;
137
return
$this;
138
}
139
143
public
function
getLimit
()
144
{
145
return
$this->limit
;
146
}
147
153
public
function
setOffset
(
$offset
)
154
{
155
$this->offset =
$offset
;
156
return
$this;
157
}
158
162
public
function
getOffset
()
163
{
164
return
$this->offset
;
165
}
166
}
Bitrix\Main\ArgumentException
Определения
ArgumentException.php:9
Bitrix\Main\Data\Connection
Определения
connection.php:17
Bitrix\Main\ORM\Query\UnionCondition
Определения
unioncondition.php:21
Bitrix\Main\ORM\Query\Union
Определения
union.php:20
Bitrix\Main\ORM\Query\Union\setOrder
setOrder($order)
Определения
union.php:65
Bitrix\Main\ORM\Query\Union\$connection
$connection
Определения
union.php:34
Bitrix\Main\ORM\Query\Union\__construct
__construct(Connection $connection)
Определения
union.php:36
Bitrix\Main\ORM\Query\Union\$order
$order
Определения
union.php:25
Bitrix\Main\ORM\Query\Union\getOrder
getOrder()
Определения
union.php:124
Bitrix\Main\ORM\Query\Union\addOrder
addOrder($definition, $order='ASC')
Определения
union.php:96
Bitrix\Main\ORM\Query\Union\$queries
$queries
Определения
union.php:22
Bitrix\Main\ORM\Query\Union\setOffset
setOffset($offset)
Определения
union.php:153
Bitrix\Main\ORM\Query\Union\addQuery
addQuery(UnionCondition $query)
Определения
union.php:46
Bitrix\Main\ORM\Query\Union\getQueries
getQueries()
Определения
union.php:55
Bitrix\Main\ORM\Query\Union\getLimit
getLimit()
Определения
union.php:143
Bitrix\Main\ORM\Query\Union\$limit
$limit
Определения
union.php:28
Bitrix\Main\ORM\Query\Union\$offset
$offset
Определения
union.php:31
Bitrix\Main\ORM\Query\Union\getOffset
getOffset()
Определения
union.php:162
Bitrix\Main\ORM\Query\Union\setLimit
setLimit($limit)
Определения
union.php:134
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$query
$query
Определения
get_search.php:11
$k
$k
Определения
template_pdf.php:567
bitrix
modules
main
lib
orm
query
union.php
Создано системой
1.14.0