1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
contactconnect.php
См. документацию.
1
<?php
2
namespace
Bitrix\Socialservices;
3
4
use Bitrix\Main;
5
use Bitrix\Main\Entity;
6
use Bitrix\Main\Type\DateTime;
7
8
37
38
class
ContactConnectTable
extends
Main\Entity\DataManager
39
{
40
const
TYPE_PORTAL
=
'P'
;
// bitrix24 portal
41
const
TYPE_EXTERNAL
=
'E'
;
// external site (box)
42
48
public
static
function
getTableName
()
49
{
50
return
'b_socialservices_contact_connect'
;
51
}
52
58
public
static
function
getMap
()
59
{
60
return
array
(
61
'ID'
=>
array
(
62
'data_type'
=>
'integer'
,
63
'primary'
=>
true
,
64
'autocomplete'
=>
true
,
65
),
66
'TIMESTAMP_X'
=>
array
(
67
'data_type'
=>
'datetime'
,
68
),
69
'CONTACT_ID'
=>
array
(
70
'data_type'
=>
'integer'
,
71
),
72
'LINK_ID'
=>
array
(
73
'data_type'
=>
'integer'
,
74
),
75
'CONTACT_PROFILE_ID'
=>
array
(
76
'data_type'
=>
'integer'
,
77
'required'
=>
true
,
78
),
79
'CONTACT_PORTAL'
=>
array
(
80
'data_type'
=>
'string'
,
81
'required'
=>
true
,
82
),
83
'LAST_AUTHORIZE'
=>
array
(
84
'data_type'
=>
'datetime'
,
85
),
86
'CONNECT_TYPE'
=>
array
(
87
'data_type'
=>
'enum'
,
88
'values'
=>
array
(static::TYPE_PORTAL, static::TYPE_EXTERNAL),
89
),
90
'CONTACT'
=>
array
(
91
'data_type'
=>
'Bitrix\Socialservices\ContactTable'
,
92
'reference'
=>
array
(
'=this.CONTACT_ID'
=>
'ref.ID'
),
93
),
94
'LINK'
=>
array
(
95
'data_type'
=>
'Bitrix\Socialservices\UserLinkTable'
,
96
'reference'
=>
array
(
'=this.LINK_ID'
=>
'ref.ID'
),
97
),
98
);
99
}
100
101
public
static
function
onBeforeUpdate
(
Entity
\
Event
$event
)
102
{
103
$result
=
new
Entity\EventResult();
104
$data
=
$event
->getParameter(
"fields"
);
105
106
if
(!isset(
$data
[
'TIMESTAMP_X'
]))
107
{
108
$data
[
'TIMESTAMP_X'
] =
new
DateTime
();
109
$result
->modifyFields(
$data
);
110
}
111
}
112
113
public
static
function
deleteByLink
($linkId)
114
{
115
$connection
=
\Bitrix\Main\Application::getConnection
();
116
return
$connection
->query(
"
117
DELETE
118
FROM "
.self::getTableName().
"
119
WHERE LINK_ID='"
.intval($linkId).
"'
120
"
);
121
}
122
123
public
static
function
deleteByContact
($contactId)
124
{
125
$connection
=
\Bitrix\Main\Application::getConnection
();
126
return
$connection
->query(
"
127
DELETE
128
FROM "
.self::getTableName().
"
129
WHERE CONTACT_ID='"
.intval($contactId).
"'
130
"
);
131
}
132
133
}
$connection
$connection
Определения
actionsdefinitions.php:38
Bitrix\Main\Application\getConnection
static getConnection($name="")
Определения
application.php:638
Bitrix\Main\Event
Определения
event.php:5
Bitrix\Main\Type\DateTime
Определения
datetime.php:9
Bitrix\Socialservices\ContactConnectTable
Определения
contactconnect.php:39
Bitrix\Socialservices\ContactConnectTable\onBeforeUpdate
static onBeforeUpdate(Entity\Event $event)
Определения
contactconnect.php:101
Bitrix\Socialservices\ContactConnectTable\getMap
static getMap()
Определения
contactconnect.php:58
Bitrix\Socialservices\ContactConnectTable\TYPE_PORTAL
const TYPE_PORTAL
Определения
contactconnect.php:40
Bitrix\Socialservices\ContactConnectTable\TYPE_EXTERNAL
const TYPE_EXTERNAL
Определения
contactconnect.php:41
Bitrix\Socialservices\ContactConnectTable\deleteByContact
static deleteByContact($contactId)
Определения
contactconnect.php:123
Bitrix\Socialservices\ContactConnectTable\deleteByLink
static deleteByLink($linkId)
Определения
contactconnect.php:113
Bitrix\Socialservices\ContactConnectTable\getTableName
static getTableName()
Определения
contactconnect.php:48
$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
Bitrix\Main\Entity
Определения
ufield.php:9
$event
$event
Определения
prolog_after.php:141
bitrix
modules
socialservices
lib
contactconnect.php
Создано системой
1.14.0