1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
connector.php
См. документацию.
1<?php
2
3namespace Bitrix\Vote\Attachment;
4
5use Bitrix\Main\Application;
6use Bitrix\Main\ObjectNotFoundException;
7use Bitrix\Main\Loader;
8use Bitrix\Main\SystemException;
9use Bitrix\Vote\Attach;
10
11abstract class Connector
12{
13 protected $entityId;
14
15 public function __construct($entityId)
16 {
17 $this->entityId = $entityId;
18 }
19
26 final public static function buildFromAttachedObject(\Bitrix\Vote\Attach $attachedObject)
27 {
28 if(!Loader::includeModule($attachedObject->getModuleId()))
29 {
30 throw new SystemException("Module {$attachedObject->getModuleId()} is not included.");
31 }
32 $className = str_replace('\\\\', '\\', $attachedObject->getEntityType());
34 if (!is_a($className, Connector::class, true))
35 {
36 throw new ObjectNotFoundException('Connector class should be instance of Bitrix\Vote\Attachment\Connector.');
37 }
38
39 $connector = new $className($attachedObject->getEntityId());
40
41 if($connector instanceof Storable)
42 {
43 $connector->setStorage($attachedObject->getStorage());
44 }
45
46 return $connector;
47 }
48
52 public static function className()
53 {
54 return get_called_class();
55 }
56
61 public function getDataToShow()
62 {
63 return array();
64 }
65
70 public function canRead($userId)
71 {
72 return false;
73 }
74
79 public function canEdit($userId)
80 {
81 return false;
82 }
83
88 public function checkFields(&$data)
89 {
90 return $data;
91 }
92
96 protected function getApplication()
97 {
98 global $APPLICATION;
99 return $APPLICATION;
100 }
101
105 protected function getUser()
106 {
107 global $USER;
108 return $USER;
109 }
110
111 public function onVoteStop(Attach $attach): void {}
112}
global $APPLICATION
Определения include.php:80
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static includeModule($moduleName)
Определения loader.php:67
canEdit($userId)
Определения connector.php:79
checkFields(&$data)
Определения connector.php:88
__construct($entityId)
Определения connector.php:15
canRead($userId)
Определения connector.php:70
onVoteStop(Attach $attach)
Определения connector.php:111
static className()
Определения connector.php:52
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
global $USER
Определения csv_new_run.php:40
Определения anonymity.php:8