Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
defaultconnector.php
1<?
3
7
8Loc::loadMessages(__FILE__);
9
10class DefaultConnector extends Connector implements Storable
11{
12 private $storage = null;
13 private $canRead = array();
14 private $canEdit = array();
15
20 public function canRead($userId)
21 {
22 if (!array_key_exists($userId, $this->canRead) && $this->isStorable())
23 $this->canRead[$userId] = $this->getStorage()->canRead($userId);
24 return (isset($this->canRead[$userId]) ? $this->canRead[$userId] : false);
25 }
26
31 public function canEdit($userId)
32 {
33 if (!array_key_exists($userId, $this->canEdit) && $this->isStorable())
34 $this->canEdit[$userId] = $this->getStorage()->canEditVote($userId);
35 return (isset($this->canEdit[$userId]) ? $this->canEdit[$userId] : false);
36 }
37
42 public function setStorage(Channel $channel)
43 {
44 $this->storage = $channel;
45
46 return $this;
47 }
48
52 public function getStorage()
53 {
54 return $this->storage;
55 }
56
60 public function isStorable()
61 {
62 return ($this->storage !== null);
63 }
64}
static loadMessages($file)
Definition loc.php:64