Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
calllog.php
1
<?php
8
namespace
Bitrix\Sender\Integration\VoxImplant
;
9
10
use
Bitrix\Main\Entity
;
11
use
Bitrix\Main\Localization\Loc
;
12
use
Bitrix\Main\Type
;
13
14
Loc::loadMessages
(__FILE__);
15
33
class
CallLogTable
extends
Entity\DataManager
34
{
40
public
static
function
getRecipientIdByCallId
($callId)
41
{
42
$row = static::getRowById(array(
'CALL_ID'
=> $callId));
43
return
$row ? $row[
'RECIPIENT_ID'
] :
null
;
44
}
45
51
public
static
function
getActualCallCount
()
52
{
53
return
static::getCount(
54
array(
'>DATE_INSERT'
=> static::getFilterCurrentDate()),
55
array(
'ttl'
=> 900)
56
);
57
}
58
59
protected
static
function
getFilterCurrentDate
()
60
{
61
$dateTime =
new
Type\DateTime
();
62
return
$dateTime->add(
'-15 minutes'
);
63
}
64
71
public
static
function
removeByCallId
($callId =
null
)
72
{
73
$list = static::getList(array(
74
'select'
=> array(
'CALL_ID'
,
'RECIPIENT_ID'
),
75
'filter'
=> array(
76
'LOGIC'
=>
'OR'
,
77
'=CALL_ID'
=> $callId,
78
'<DATE_INSERT'
=> static::getFilterCurrentDate(),
79
)
80
));
81
foreach
($list as $item)
82
{
83
static::delete($item);
84
}
85
}
86
92
public
static
function
getTableName
()
93
{
94
return
'b_sender_call_log'
;
95
}
96
102
public
static
function
getMap
()
103
{
104
return
array(
105
'CALL_ID'
=> array(
106
'data_type'
=>
'string'
,
107
'primary'
=>
true
,
108
),
109
'RECIPIENT_ID'
=> array(
110
'data_type'
=>
'integer'
,
111
'primary'
=>
true
,
112
),
113
'DATE_INSERT'
=> array(
114
'data_type'
=>
'datetime'
,
115
'required'
=>
true
,
116
'default_value'
=>
new
Type
\
DateTime
(),
117
),
118
);
119
}
120
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Sender\Integration\VoxImplant\CallLogTable
Definition
calllog.php:34
Bitrix\Sender\Integration\VoxImplant\CallLogTable\getMap
static getMap()
Definition
calllog.php:102
Bitrix\Sender\Integration\VoxImplant\CallLogTable\getActualCallCount
static getActualCallCount()
Definition
calllog.php:51
Bitrix\Sender\Integration\VoxImplant\CallLogTable\removeByCallId
static removeByCallId($callId=null)
Definition
calllog.php:71
Bitrix\Sender\Integration\VoxImplant\CallLogTable\getRecipientIdByCallId
static getRecipientIdByCallId($callId)
Definition
calllog.php:40
Bitrix\Sender\Integration\VoxImplant\CallLogTable\getTableName
static getTableName()
Definition
calllog.php:92
Bitrix\Sender\Integration\VoxImplant\CallLogTable\getFilterCurrentDate
static getFilterCurrentDate()
Definition
calllog.php:59
Bitrix\Main\Type
Definition
collection.php:2
Bitrix\Sender\Integration\VoxImplant
Definition
audio.php:9
modules
sender
lib
integration
voximplant
calllog.php
Создано системой
1.10.0