1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
comment.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Socialnetwork\Controller\Livefeed;
4
5
use Bitrix\Main\Error;
6
use Bitrix\Main\Localization\Loc;
7
use Bitrix\Socialnetwork\Controller\Base;
8
use Bitrix\Socialnetwork\LogCommentTable;
9
10
class
Comment
extends
Base
11
{
12
public
function
getSourceAction
(
array
$params
= []): ?
array
13
{
14
$postId = (int)(
$params
[
'postId'
] ?? 0);
15
$commentId = (int)(
$params
[
'commentId'
] ?? 0);
16
17
if
($commentId <= 0)
18
{
19
$this->
addError
(
new
Error
(Loc::getMessage(
'SONET_CONTROLLER_LIVEFEED_COMMENT_COMMENT_EMPTY'
),
'SONET_CONTROLLER_LIVEFEED_COMMENT_COMMENT_EMPTY'
));
20
return
null
;
21
}
22
23
if
($postId <= 0)
24
{
25
$res
=
LogCommentTable::getList
([
26
'filter'
=> [
27
'=ID'
=> $commentId
28
],
29
'select'
=> [
'LOG_ID'
]
30
]);
31
if
($logComment =
$res
->fetch())
32
{
33
$postId = (int)$logComment[
'LOG_ID'
];
34
}
35
}
36
37
if
($postId <= 0)
38
{
39
$this->
addError
(
new
Error
(Loc::getMessage(
'SONET_CONTROLLER_LIVEFEED_COMMENT_POST_NOT_FOUND'
),
'SONET_CONTROLLER_LIVEFEED_COMMENT_POST_NOT_FOUND'
));
40
return
null
;
41
}
42
43
$commentData = \CSocNetLogComponent::getCommentByRequest($commentId, $postId,
'edit'
);
44
if
($commentData)
45
{
46
$result
= [
47
'id'
=> (int)$commentData[
'ID'
],
48
'message'
=> str_replace(
"<br />"
,
"\n"
, $commentData[
'MESSAGE'
]),
49
'sourceId'
=> (
50
(int)$commentData[
'SOURCE_ID'
] > 0
51
? (int)$commentData[
'SOURCE_ID'
]
52
: (int)$commentData[
'ID'
]
53
),
54
'UF'
=> (
55
!empty($commentData[
'UF'
])
56
? $commentData[
'UF'
]
57
: []
58
)
59
];
60
}
61
else
62
{
63
$this->
addError
(
new
Error
(Loc::getMessage(
'SONET_CONTROLLER_LIVEFEED_COMMENT_COMMENT_NOT_FOUND'
),
'SONET_CONTROLLER_LIVEFEED_COMMENT_COMMENT_NOT_FOUND'
));
64
return
null
;
65
}
66
67
return
$result
;
68
}
69
}
Bitrix\Main\Engine\ActionFilter\Base
Определения
base.php:15
Bitrix\Main\Engine\ActionFilter\Base\addError
addError(Error $error)
Определения
base.php:80
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Main\ORM\Data\DataManager\getList
static getList(array $parameters=array())
Определения
datamanager.php:431
Bitrix\Socialnetwork\Controller\Livefeed\Comment
Определения
comment.php:11
Bitrix\Socialnetwork\Controller\Livefeed\Comment\getSourceAction
getSourceAction(array $params=[])
Определения
comment.php:12
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$res
$res
Определения
filter_act.php:7
$result
$result
Определения
get_property_values.php:14
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
socialnetwork
lib
controller
livefeed
comment.php
Создано системой
1.14.0