1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
warning.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Translate;
4
5
use Bitrix\Main;
6
10
trait
Warning
11
{
13
protected
$warningCollection;
14
22
final
public
function
addWarning
(
Main
\
Error
$error
): self
23
{
24
if
(!$this->warningCollection instanceof
Main
\
ErrorCollection
)
25
{
26
$this->warningCollection =
new
Main\ErrorCollection
;
27
}
28
29
$this->warningCollection[] =
$error
;
30
31
return
$this;
32
}
33
39
final
public
function
getWarnings
():
array
40
{
41
if
(!$this->warningCollection instanceof
Main
\
ErrorCollection
)
42
{
43
return
array
();
44
}
45
46
return
$this->warningCollection->toArray();
47
}
48
54
final
public
function
hasWarnings
(): bool
55
{
56
if
(!$this->warningCollection instanceof
Main
\
ErrorCollection
)
57
{
58
return
false
;
59
}
60
61
return
!$this->warningCollection->isEmpty();
62
}
63
69
final
public
function
getLastWarning
(): ?
Main
\
Error
70
{
71
if
(!$this->warningCollection instanceof
Main
\
ErrorCollection
)
72
{
73
return
null
;
74
}
75
if
(!$this->
hasWarnings
())
76
{
77
return
null
;
78
}
79
80
$offset = $this->warningCollection->count() - 1;
81
82
return
$this->warningCollection->offsetGet($offset);
83
}
84
90
final
public
function
getFirstWarning
(): ?
Main
\
Error
91
{
92
if
(!$this->warningCollection instanceof
Main
\
ErrorCollection
)
93
{
94
return
null
;
95
}
96
if
(!$this->
hasWarnings
())
97
{
98
return
null
;
99
}
100
101
return
$this->warningCollection->offsetGet(0);
102
}
103
}
Bitrix\Main\ErrorCollection
Определения
errorcollection.php:14
Bitrix\Main\Error
Определения
error.php:15
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Main
Bitrix\Translate\getFirstWarning
getFirstWarning()
Определения
warning.php:90
Bitrix\Translate\Warning
trait Warning
Определения
warning.php:11
Bitrix\Translate\getLastWarning
getLastWarning()
Определения
warning.php:69
Bitrix\Translate\addWarning
addWarning(Main\Error $error)
Определения
warning.php:22
Bitrix\Translate\getWarnings
getWarnings()
Определения
warning.php:39
Bitrix\Translate\hasWarnings
hasWarnings()
Определения
warning.php:54
$error
$error
Определения
subscription_card_product.php:20
bitrix
modules
translate
lib
warning.php
Создано системой
1.14.0