1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
b24integrationbindtable.php
См. документацию.
1
<?php
2
namespace
Bitrix\Sale\Exchange\Integration\Entity;
3
4
use Bitrix\Main;
5
22
class
B24IntegrationBindTable
extends
Main\Entity\DataManager
23
{
24
public
static
function
getTableName
()
25
{
26
return
'b_sale_b24integration_bind'
;
27
}
28
29
public
static
function
getMap
()
30
{
31
return
[
32
new
Main\Entity\IntegerField(
'ID'
),
33
new
Main\Entity\IntegerField(
'SRC_ENTITY_TYPE_ID'
, [
'primary'
=>
true
]),
34
new
Main\Entity\IntegerField(
'SRC_ENTITY_ID'
, [
'primary'
=>
true
]),
35
new
Main\Entity\IntegerField(
'DST_ENTITY_TYPE_ID'
, [
'primary'
=>
true
]),
36
new
Main\Entity\IntegerField(
'DST_ENTITY_ID'
, [
'primary'
=>
true
]),
37
new
Main\Entity\DatetimeField(
'CREATED_TIME'
),
38
new
Main\Entity\DatetimeField(
'LAST_UPDATED_TIME'
)
39
];
40
}
41
42
public
static
function
upsert
(
array
$data
)
43
{
44
$result
=
new
Main\Entity\AddResult();
45
46
$srcEntityTypeID = isset(
$data
[
'SRC_ENTITY_TYPE_ID'
]) ? (int)
$data
[
'SRC_ENTITY_TYPE_ID'
] : \CCrmOwnerType::Undefined;
47
$srcEntityID = isset(
$data
[
'SRC_ENTITY_ID'
]) ? (int)
$data
[
'SRC_ENTITY_ID'
] : 0;
48
49
$dstEntityTypeID = isset(
$data
[
'DST_ENTITY_TYPE_ID'
]) ? (int)
$data
[
'DST_ENTITY_TYPE_ID'
] : \CCrmOwnerType::Undefined;
50
$dstEntityID = isset(
$data
[
'DST_ENTITY_ID'
]) ? (int)
$data
[
'DST_ENTITY_ID'
] : 0;
51
52
$now =
Main\Type\DateTime::createFromTimestamp
(time() + \CTimeZone::GetOffset());
53
54
$insertFields = [
55
'SRC_ENTITY_TYPE_ID'
=> $srcEntityTypeID,
56
'SRC_ENTITY_ID'
=> $srcEntityID,
57
'DST_ENTITY_TYPE_ID'
=> $dstEntityTypeID,
58
'DST_ENTITY_ID'
=> $dstEntityID,
59
'CREATED_TIME'
=> $now,
60
'LAST_UPDATED_TIME'
=> $now
61
];
62
63
$updateFields = [
64
'LAST_UPDATED_TIME'
=> $now,
65
'SRC_ENTITY_TYPE_ID'
=> $srcEntityTypeID,
66
'SRC_ENTITY_ID'
=> $srcEntityID,
67
'DST_ENTITY_TYPE_ID'
=> $dstEntityTypeID,
68
'DST_ENTITY_ID'
=> $dstEntityID
69
];
70
71
$connection
=
Main\Application::getConnection
();
72
$queries =
$connection
->getSqlHelper()->prepareMerge(
73
static::getTableName(),
74
[
75
'SRC_ENTITY_TYPE_ID'
,
76
'SRC_ENTITY_ID'
,
77
'DST_ENTITY_TYPE_ID'
,
78
'DST_ENTITY_ID'
79
],
80
$insertFields,
81
$updateFields
82
);
83
84
foreach
($queries as
$query
)
85
{
86
$connection
->queryExecute(
$query
);
87
}
88
89
$result
->setId(
90
$connection
->getInsertedId());
91
92
return
$result
;
93
}
94
}
$connection
$connection
Определения
actionsdefinitions.php:38
Bitrix\Main\Application\getConnection
static getConnection($name="")
Определения
application.php:638
Bitrix\Main\Type\DateTime\createFromTimestamp
static createFromTimestamp($timestamp)
Определения
datetime.php:246
Bitrix\Sale\Exchange\Integration\Entity\B24IntegrationBindTable
Определения
b24integrationbindtable.php:23
Bitrix\Sale\Exchange\Integration\Entity\B24IntegrationBindTable\getMap
static getMap()
Определения
b24integrationbindtable.php:29
Bitrix\Sale\Exchange\Integration\Entity\B24IntegrationBindTable\upsert
static upsert(array $data)
Определения
b24integrationbindtable.php:42
Bitrix\Sale\Exchange\Integration\Entity\B24IntegrationBindTable\getTableName
static getTableName()
Определения
b24integrationbindtable.php:24
$data
$data['IS_AVAILABLE']
Определения
.description.php:13
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
$query
$query
Определения
get_search.php:11
bitrix
modules
sale
lib
exchange
integration
entity
b24integrationbindtable.php
Создано системой
1.14.0