1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
AttachedVotePayload.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Vote\Model\Dto
;
4
5
use
Bitrix\Main\ObjectNotFoundException
;
6
use
Bitrix\Main\Security\Sign\BadSignatureException
;
7
use
Bitrix\Vote\Attach
;
8
use
Bitrix\Vote\Attachment\Manager
;
9
use
Bitrix\Vote\Service\AttachedVoteResultUrlService
;
10
use
Bitrix\Vote\Service\AttachedVoteSigner
;
11
12
class
AttachedVotePayload
13
{
14
public
function
__construct
(
15
public
readonly ?
Attach
$attach,
16
public
readonly
bool
$readAccessThroughSignedParam =
false
,
17
)
18
{}
19
20
public
static
function
makeByAttachId
(
int
$attachId):
AttachedVotePayload
21
{
22
try
23
{
24
$attach =
new
Attach
($attachId);
25
}
26
catch
(
ObjectNotFoundException
)
27
{
28
$attach =
null
;
29
}
30
31
return
new
AttachedVotePayload
($attach);
32
}
33
34
public
static
function
makeByEntityId
(
35
string
$moduleId
,
36
string
$entityType,
37
int
$entityId
38
):
AttachedVotePayload
39
{
40
return
new
AttachedVotePayload
(Manager::loadFirstFromEntity(
$moduleId
, $entityType,
$entityId
));
41
}
42
43
public
static
function
makeBySignedAttachId
(
string
$signedAttachId):
AttachedVotePayload
44
{
45
try
46
{
47
$attach = (
new
AttachedVoteResultUrlService
())->getAttachByUrlId($signedAttachId);
48
}
49
catch
(
ObjectNotFoundException
|
BadSignatureException
)
50
{
51
$attach =
null
;
52
}
53
54
return
new
AttachedVotePayload
($attach,
true
);
55
}
56
}
Bitrix\Main\ObjectNotFoundException
Определения
ObjectNotFoundException.php:9
Bitrix\Main\Security\Sign\BadSignatureException
Определения
badsignatureexception.php:13
Bitrix\Vote\Attach
Определения
attach.php:180
Bitrix\Vote\Attachment\Manager
Определения
manager.php:13
Bitrix\Vote\Model\Dto\AttachedVotePayload
Определения
AttachedVotePayload.php:13
Bitrix\Vote\Model\Dto\AttachedVotePayload\__construct
__construct(public readonly ?Attach $attach, public readonly bool $readAccessThroughSignedParam=false,)
Определения
AttachedVotePayload.php:14
Bitrix\Vote\Model\Dto\AttachedVotePayload\makeByAttachId
static makeByAttachId(int $attachId)
Определения
AttachedVotePayload.php:20
Bitrix\Vote\Model\Dto\AttachedVotePayload\makeBySignedAttachId
static makeBySignedAttachId(string $signedAttachId)
Определения
AttachedVotePayload.php:43
Bitrix\Vote\Model\Dto\AttachedVotePayload\makeByEntityId
static makeByEntityId(string $moduleId, string $entityType, int $entityId)
Определения
AttachedVotePayload.php:34
Bitrix\Vote\Service\AttachedVoteResultUrlService
Определения
AttachedVoteResultUrlService.php:15
Bitrix\Vote\Service\AttachedVoteSigner
Определения
AttachedVoteSigner.php:8
$moduleId
$moduleId
Определения
group_bizproc_workflow_delete.php:16
Bitrix\Vote\Model\Dto
Определения
AttachedVotePayload.php:3
$entityId
$entityId
Определения
payment.php:4
bitrix
modules
vote
lib
Model
Dto
AttachedVotePayload.php
Создано системой
1.14.0