Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
logcomment.php
1
<?php
8
namespace
Bitrix\Socialnetwork
;
9
10
use
Bitrix\Main\ORM
;
11
use
Bitrix\Socialnetwork\Item\LogIndex
;
12
29
class
LogCommentTable
extends
ORM\Data\DataManager
30
{
31
public
static
function
getTableName
()
32
{
33
return
'b_sonet_log_comment'
;
34
}
35
36
public
static
function
getUfId
()
37
{
38
return
'SONET_COMMENT'
;
39
}
40
41
public
static
function
getMap
()
42
{
43
$fieldsMap = array(
44
'ID'
=> array(
45
'data_type'
=>
'integer'
,
46
'primary'
=>
true
,
47
'autocomplete'
=>
true
,
48
),
49
'LOG_ID'
=> array(
50
'data_type'
=>
'integer'
,
51
),
52
'LOG'
=> array(
53
'data_type'
=>
'Bitrix\Socialnetwork\LogTable'
,
54
'reference'
=> array(
'=this.LOG_ID'
=>
'ref.ID'
),
55
),
56
'EVENT_ID'
=> array(
57
'data_type'
=>
'string'
,
58
),
59
'USER_ID'
=> array(
60
'data_type'
=>
'integer'
,
61
),
62
'MESSAGE'
=> array(
63
'data_type'
=>
'text'
,
64
),
65
'SOURCE_ID'
=> array(
66
'data_type'
=>
'integer'
,
67
),
68
'LOG_DATE'
=> array(
69
'data_type'
=>
'datetime'
,
70
),
71
'SHARE_DEST'
=> array(
72
'data_type'
=>
'string'
,
73
),
74
'RATING_TYPE_ID'
=> array(
75
'data_type'
=>
'string'
,
76
),
77
'RATING_ENTITY_ID'
=> array(
78
'data_type'
=>
'integer'
,
79
),
80
);
81
82
return
$fieldsMap;
83
}
84
85
public
static
function
onAfterDelete
(ORM\
Event
$event)
86
{
87
$result =
new
ORM\EventResult;
88
$primary = $event->getParameter(
'primary'
);
89
$commentId = (!empty($primary[
'ID'
]) ? (int)$primary[
'ID'
] : 0);
90
91
if
($commentId > 0)
92
{
93
LogIndex::deleteIndex(array(
94
'itemType'
=>
LogIndexTable::ITEM_TYPE_COMMENT
,
95
'itemId'
=> $commentId
96
));
97
98
LogTagTable::deleteByItem
(array(
99
'itemType'
=>
LogTagTable::ITEM_TYPE_COMMENT
,
100
'itemId'
=> $commentId
101
));
102
}
103
104
return
$result;
105
}
106
}
Bitrix\Main\Event
Definition
event.php:5
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Socialnetwork\Item\LogIndex
Definition
logindex.php:21
Bitrix\Socialnetwork\LogCommentTable
Definition
logcomment.php:30
Bitrix\Socialnetwork\LogCommentTable\getMap
static getMap()
Definition
logcomment.php:41
Bitrix\Socialnetwork\LogCommentTable\getUfId
static getUfId()
Definition
logcomment.php:36
Bitrix\Socialnetwork\LogCommentTable\onAfterDelete
static onAfterDelete(ORM\Event $event)
Definition
logcomment.php:85
Bitrix\Socialnetwork\LogCommentTable\getTableName
static getTableName()
Definition
logcomment.php:31
Bitrix\Socialnetwork\LogIndexTable\ITEM_TYPE_COMMENT
const ITEM_TYPE_COMMENT
Definition
logindex.php:35
Bitrix\Socialnetwork\LogTagTable\ITEM_TYPE_COMMENT
const ITEM_TYPE_COMMENT
Definition
logtag.php:31
Bitrix\Socialnetwork\LogTagTable\deleteByItem
static deleteByItem($params=array())
Definition
logtag.php:86
Bitrix\Main\ORM
Bitrix\Socialnetwork
modules
socialnetwork
lib
logcomment.php
Создано системой
1.10.0