1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
manager.php
См. документацию.
1<?php
2namespace Bitrix\Vote\Attachment;
3
4use Bitrix\Main\Localization\Loc;
5use Bitrix\Main\ArgumentNullException;
6use Bitrix\Main\ArgumentTypeException;
7use Bitrix\Vote\Attach;
8use Bitrix\Vote\Vote;
9
10Loc::loadMessages(__FILE__);
11
12final 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();
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 {
99 foreach ($votes as $v)
100 $v->delete();
101 }
102
103 public static function loadFirstFromEntity(string $moduleId, string $entityType, int $entityId): ?Attach
104 {
105 $attaches = Manager::loadFromEntity([
106 '=MODULE_ID' => $moduleId,
107 '=ENTITY_TYPE' => $entityType,
108 '=ENTITY_ID' => $entityId,
109 ]);
110
111 return $attaches[array_key_first($attaches)] ?? null;
112 }
113}
114
static getData($id)
Определения attach.php:271
static loadFromVoteId(array $attach, $id)
Определения manager.php:31
static loadEmptyAttach(array $attach, array $voteParams)
Определения manager.php:58
static loadFirstFromEntity(string $moduleId, string $entityType, int $entityId)
Определения manager.php:103
static loadFromAttachId($id)
Определения manager.php:20
static loadFromEntity(array $filter)
Определения manager.php:71
static detachByFilter(array $filter)
Определения manager.php:96
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
$moduleId
$filter
Определения iblock_catalog_list.php:54
$entityId
Определения payment.php:4