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