Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
action.php
1
<?php
9
namespace
Bitrix\Main\EventLog
;
10
11
abstract
class
Action
12
{
13
const
TYPE_EMAIL
=
'email'
;
14
const
TYPE_SMS
=
'sms'
;
15
16
protected
$type
;
17
protected
$recipient
;
18
protected
$text
;
19
26
public
function
__construct
(
$type
,
$recipient
,
$text
)
27
{
28
$this->type =
$type
;
29
$this->recipient =
$recipient
;
30
$this->text =
$text
;
31
}
32
41
public
static
function
createByType
(
$type
,
$recipient
,
$text
)
42
{
43
switch
(
$type
)
44
{
45
case
self::TYPE_EMAIL
:
46
return
new
ActionEmail
(
$recipient
,
$text
);
47
case
self::TYPE_SMS
:
48
return
new
ActionSms
(
$recipient
,
$text
);
49
default
:
50
throw
new \Bitrix\Main\ArgumentException(
"Unknown action type"
,
"type"
);
51
}
52
}
53
58
public
function
getType
()
59
{
60
return
$this->type
;
61
}
62
67
public
function
getRecipient
()
68
{
69
return
$this->recipient
;
70
}
71
76
public
function
getText
()
77
{
78
return
$this->text
;
79
}
80
85
abstract
public
function
send
(
Notification
$notification);
86
87
protected
static
function
getNotificationFields
(
Notification
$notification)
88
{
89
return
[
90
"NAME"
=> $notification->getName(),
91
"AUDIT_TYPE_ID"
=> $notification->getAuditTypeId(),
92
"ITEM_ID"
=> $notification->getItemId(),
93
"USER_ID"
=> $notification->getUserId(),
94
"REMOTE_ADDR"
=> $notification->getRemoteAddr(),
95
"USER_AGENT"
=> $notification->getUserAgent(),
96
"REQUEST_URI"
=> $notification->getRequestUri(),
97
"EVENT_COUNT"
=> $notification->
getEventCount
(),
98
];
99
}
100
}
Bitrix\Main\EventLog\ActionEmail
Definition
actionemail.php:12
Bitrix\Main\EventLog\Action
Definition
action.php:12
Bitrix\Main\EventLog\Action\__construct
__construct($type, $recipient, $text)
Definition
action.php:26
Bitrix\Main\EventLog\Action\getRecipient
getRecipient()
Definition
action.php:67
Bitrix\Main\EventLog\Action\createByType
static createByType($type, $recipient, $text)
Definition
action.php:41
Bitrix\Main\EventLog\Action\TYPE_SMS
const TYPE_SMS
Definition
action.php:14
Bitrix\Main\EventLog\Action\send
send(Notification $notification)
Bitrix\Main\EventLog\Action\getType
getType()
Definition
action.php:58
Bitrix\Main\EventLog\Action\getText
getText()
Definition
action.php:76
Bitrix\Main\EventLog\Action\$type
$type
Definition
action.php:16
Bitrix\Main\EventLog\Action\TYPE_EMAIL
const TYPE_EMAIL
Definition
action.php:13
Bitrix\Main\EventLog\Action\getNotificationFields
static getNotificationFields(Notification $notification)
Definition
action.php:87
Bitrix\Main\EventLog\Action\$recipient
$recipient
Definition
action.php:17
Bitrix\Main\EventLog\Action\$text
$text
Definition
action.php:18
Bitrix\Main\EventLog\ActionSms
Definition
actionsms.php:12
Bitrix\Main\EventLog\Notification
Definition
notification.php:43
Bitrix\Main\EventLog\Notification\getEventCount
getEventCount()
Definition
notification.php:239
Bitrix\Main\EventLog
Definition
action.php:9
modules
main
lib
eventlog
action.php
Создано системой
1.10.0