Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
defaultconnector.php
1
<?
2
namespace
Bitrix\Vote\Attachment
;
3
4
use
Bitrix\Main\Loader
;
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Vote\Channel
;
7
8
Loc::loadMessages
(__FILE__);
9
10
class
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
}
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Vote\Attachment\Connector
Definition
connector.php:11
Bitrix\Vote\Attachment\DefaultConnector
Definition
defaultconnector.php:11
Bitrix\Vote\Attachment\DefaultConnector\canEdit
canEdit($userId)
Definition
defaultconnector.php:31
Bitrix\Vote\Attachment\DefaultConnector\getStorage
getStorage()
Definition
defaultconnector.php:52
Bitrix\Vote\Attachment\DefaultConnector\canRead
canRead($userId)
Definition
defaultconnector.php:20
Bitrix\Vote\Attachment\DefaultConnector\isStorable
isStorable()
Definition
defaultconnector.php:60
Bitrix\Vote\Attachment\DefaultConnector\setStorage
setStorage(Channel $channel)
Definition
defaultconnector.php:42
Bitrix\Vote\Channel
Definition
channel.php:225
Bitrix\Vote\Attachment\Storable
Definition
storable.php:8
Bitrix\Vote\Attachment
Definition
blogpostconnector.php:2
modules
vote
lib
attachment
defaultconnector.php
Создано системой
1.10.0