1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
Im.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Vote\Controller\Integration
;
4
5
6
use
Bitrix\Main\Engine\Controller
;
7
use
Bitrix\Main\Engine\CurrentUser
;
8
use
Bitrix\Main\Error
;
9
use
Bitrix\Vote\Integration\Im\ImVote
;
10
use
Bitrix\Vote\Integration\Im\Result\ImVoteSendResult
;
11
12
class
Im
extends
Controller
13
{
14
public
function
sendAction
(
15
int
$chatId,
16
array
$IM_MESSAGE_VOTE_DATA,
17
?
string
$templateId
=
null
,
18
): ?
array
19
{
20
$currentUserId = (int)CurrentUser::get()->getId();
21
if
($currentUserId <= 0)
22
{
23
$this->addError(
new
Error
(
'Access denied'
));
24
25
return
null
;
26
}
27
28
$result
=
ImVote::sendVote
($chatId, $currentUserId, $IM_MESSAGE_VOTE_DATA,
$templateId
);
29
if
(
$result
instanceof
ImVoteSendResult
)
30
{
31
return
[
32
'messageId'
=>
$result
->messageId,
33
'voteId'
=>
$result
->voteId,
34
];
35
}
36
37
$this->addErrors(
$result
->getErrors());
38
39
return
null
;
40
}
41
}
Bitrix\Main\Engine\CurrentUser
Определения
currentuser.php:8
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Vote\Controller\Integration\Im
Определения
Im.php:13
Bitrix\Vote\Controller\Integration\Im\sendAction
sendAction(int $chatId, array $IM_MESSAGE_VOTE_DATA, ?string $templateId=null,)
Определения
Im.php:14
Bitrix\Vote\Integration\Im\ImVote
Определения
ImVote.php:19
Bitrix\Vote\Integration\Im\ImVote\sendVote
static sendVote(int $chatId, int $ownerUserId, array $voteFields, ?string $templateId=null,)
Определения
ImVote.php:43
Bitrix\Vote\Integration\Im\Result\ImVoteSendResult
Определения
ImVoteSendResult.php:8
$templateId
$templateId
Определения
component_props2.php:51
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\Controller
Определения
agreement.php:2
Bitrix\Vote\Controller\Integration
Определения
Im.php:3
bitrix
modules
vote
lib
Controller
Integration
Im.php
Создано системой
1.14.0