Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
manager.php
1<?php
3
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();
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
static loadMessages($file)
Definition loc.php:64
static getData($id)
Definition attach.php:246
static loadFromVoteId(array $attach, $id)
Definition manager.php:31
static loadEmptyAttach(array $attach, array $voteParams)
Definition manager.php:58
static loadFromEntity(array $filter)
Definition manager.php:71
static detachByFilter(array $filter)
Definition manager.php:96