Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
manager.php
1
<?php
2
namespace
Bitrix\Vote\Attachment
;
3
4
use
Bitrix\Main\Localization\Loc
;
5
use
Bitrix\Main\ArgumentNullException
;
6
use
Bitrix\Main\ArgumentTypeException
;
7
use
Bitrix\Vote\Attach
;
8
use
Bitrix\Vote\Vote
;
9
10
Loc::loadMessages
(__FILE__);
11
12
final
class
Manager
13
{
14
20
public
static
function
loadFromAttachId
($id)
21
{
22
return
new
Attach
($id);
23
}
24
31
public
static
function
loadFromVoteId
(array $attach, $id)
32
{
33
$attach =
new
Attach
($attach);
34
$attach->setVote($id);
35
return
$attach;
36
}
37
58
public
static
function
loadEmptyAttach
(array $attach, array $voteParams)
59
{
60
$attach =
new
Attach
($attach);
61
$attach->setStorage($voteParams[
"CHANNEL_ID"
]);
62
return
$attach;
63
}
64
71
public
static
function
loadFromEntity
(array $filter)
72
{
73
$filter = array_change_key_case($filter, CASE_UPPER);
74
if
(empty($filter))
75
throw
new
ArgumentNullException
(
"filter"
);
76
77
$return = array();
78
$res =
Attach::getData
($filter);
79
if
(is_array($res))
80
{
81
foreach
($res as $attach)
82
{
83
$res =
new
Attach
($attach[0]);
84
$res->setVote($attach[1][
"ID"
]);
85
$return[$attach[0][
"ID"
]] = $res;
86
}
87
}
88
return
$return;
89
}
90
96
public
static
function
detachByFilter
(array $filter)
97
{
98
$votes =
self::loadFromEntity
($filter);
99
foreach
($votes as $v)
100
$v->delete();
101
}
102
}
103
Bitrix\Main\ArgumentNullException
Definition
exception.php:54
Bitrix\Main\ArgumentTypeException
Definition
exception.php:114
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Vote\Attach
Definition
attach.php:158
Bitrix\Vote\Attach\getData
static getData($id)
Definition
attach.php:246
Bitrix\Vote\Attachment\Manager
Definition
manager.php:13
Bitrix\Vote\Attachment\Manager\loadFromVoteId
static loadFromVoteId(array $attach, $id)
Definition
manager.php:31
Bitrix\Vote\Attachment\Manager\loadEmptyAttach
static loadEmptyAttach(array $attach, array $voteParams)
Definition
manager.php:58
Bitrix\Vote\Attachment\Manager\loadFromAttachId
static loadFromAttachId($id)
Definition
manager.php:20
Bitrix\Vote\Attachment\Manager\loadFromEntity
static loadFromEntity(array $filter)
Definition
manager.php:71
Bitrix\Vote\Attachment\Manager\detachByFilter
static detachByFilter(array $filter)
Definition
manager.php:96
Bitrix\Vote\Attachment
Definition
blogpostconnector.php:2
Bitrix\Vote\Vote
Definition
anonymity.php:8
modules
vote
lib
attachment
manager.php
Создано системой
1.10.0