1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
recipiententry.php
См. документацию.
1
<?php
2
namespace
Bitrix\Sender\Integration\Crm\Timeline;
3
4
use Bitrix\Crm\Timeline;
5
use Bitrix\Crm\Timeline\Entity\TimelineTable;
6
use Bitrix\Main;
7
use Bitrix\Main\Type\DateTime;
8
13
class
RecipientEntry
extends
Timeline\TimelineEntry
14
{
22
public
static
function
create
(
array
$params
)
23
{
24
$entityTypeId = isset(
$params
[
'ENTITY_TYPE_ID'
]) ? (int)
$params
[
'ENTITY_TYPE_ID'
] : 0;
25
if
($entityTypeId <= 0)
26
{
27
throw
new
Main\ArgumentException
(
'Entity type ID must be greater than zero.'
,
'entityTypeID'
);
28
}
29
30
$entityId
= isset(
$params
[
'ENTITY_ID'
]) ? (int)
$params
[
'ENTITY_ID'
] : 0;
31
if
(
$entityId
<= 0)
32
{
33
throw
new
Main\ArgumentException
(
'Entity ID must be greater than zero.'
,
'entityID'
);
34
}
35
36
$typeCategoryId = isset(
$params
[
'TYPE_CATEGORY_ID'
]) ?
$params
[
'TYPE_CATEGORY_ID'
] : 0;
37
if
(!$typeCategoryId)
38
{
39
throw
new
Main\ArgumentException
(
'Type category ID must not be empty.'
,
'typeCategoryId'
);
40
}
41
42
$authorId = isset(
$params
[
'AUTHOR_ID'
]) ? (int)
$params
[
'AUTHOR_ID'
] : 0;
43
if
(!is_int($authorId))
44
{
45
$authorId = (int) $authorId;
46
}
47
48
if
($authorId <= 0)
49
{
50
throw
new
Main\ArgumentException
(
'Author ID must be greater than zero.'
,
'authorID'
);
51
}
52
53
$created = (isset(
$params
[
'CREATED'
]) && (
$params
[
'CREATED'
] instanceof
DateTime
)) ?
$params
[
'CREATED'
] :
new
DateTime
();
54
$settings
= isset(
$params
[
'SETTINGS'
]) && is_array(
$params
[
'SETTINGS'
]) ?
$params
[
'SETTINGS'
] :
array
();
55
56
$result
= TimelineTable::add(
57
array
(
58
'TYPE_ID'
=>
Timeline
\TimelineType::SENDER,
59
'TYPE_CATEGORY_ID'
=> $typeCategoryId,
60
'CREATED'
=> $created,
61
'AUTHOR_ID'
=> $authorId,
62
'SETTINGS'
=>
$settings
,
63
'ASSOCIATED_ENTITY_TYPE_ID'
=> $entityTypeId,
64
'ASSOCIATED_ENTITY_ID'
=>
$entityId
65
)
66
);
67
68
if
(!
$result
->isSuccess())
69
{
70
return
0;
71
}
72
$id =
$result
->getId();
73
74
$bindings = isset(
$params
[
'BINDINGS'
]) && is_array(
$params
[
'BINDINGS'
]) ?
$params
[
'BINDINGS'
] :
array
();
75
if
(empty($bindings))
76
{
77
$bindings[] =
array
(
'ENTITY_TYPE_ID'
=> $entityTypeId,
'ENTITY_ID'
=>
$entityId
);
78
}
79
self::registerBindings($id, $bindings);
80
81
return
$id;
82
}
83
90
public
static
function
createMulti
(
array
$parameters)
91
{
92
$ids = [];
93
foreach
($parameters as
$params
)
94
{
95
$ids[] =
self::create
(
$params
);
96
}
97
98
return
$ids;
99
}
100
}
Bitrix\Main\ArgumentException
Определения
ArgumentException.php:9
Bitrix\Main\Type\DateTime
Определения
datetime.php:9
Bitrix\Sender\Integration\Crm\Timeline\RecipientEntry
Определения
recipiententry.php:14
Bitrix\Sender\Integration\Crm\Timeline\RecipientEntry\createMulti
static createMulti(array $parameters)
Определения
recipiententry.php:90
Bitrix\Sender\Integration\Crm\Timeline\RecipientEntry\create
static create(array $params)
Определения
recipiententry.php:22
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
Bitrix\Sender\Integration\Crm\Timeline
Определения
recipientcontroller.php:2
$entityId
$entityId
Определения
payment.php:4
$settings
$settings
Определения
product_settings.php:43
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
sender
lib
integration
crm
timeline
recipiententry.php
Создано системой
1.14.0