Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
renderer.php
1<?php
2
4
5use CUserTypeManager;
6
12{
19 protected
23 'bVarsFromForm' => false
24 ],
26
32 public function __construct(array $userField, ?array $additionalParameters = [])
33 {
34 $this->setUserField($userField);
36
37 if($this->getAdditionalParameter('mode'))
38 {
39 $this->setMode($this->getAdditionalParameter('mode'));
40 }
41 }
42
46 public function render(): ?string
47 {
48 global $USER_FIELD_MANAGER;
49
50 return $USER_FIELD_MANAGER->renderField(
51 $this->getUserField(),
53 );
54 }
55
59 public function getMode()
60 {
61 return $this->mode;
62 }
63
68 public function setMode($mode): Renderer
69 {
70 $this->mode = $mode;
71 return $this;
72 }
73
77 public function getUserField(): array
78 {
79 return $this->userField;
80 }
81
88 public function setAdditionalParameter(string $param, $value, ?bool $storeAsDefault = false): Renderer
89 {
90 $this->additionalParameters[$param] = $value;
91 if($storeAsDefault)
92 {
93 $this->defaultAdditionalParameters[$param] = $value;
94 }
95 return $this;
96 }
97
102 public function getAdditionalParameter(string $param)
103 {
104 return ($this->additionalParameters[$param] ?: null);
105 }
106
110 protected function getAdditionalParameters(): array
111 {
113 }
114
119 public function setUserField(array $userField): Renderer
120 {
121 $this->userField = $userField;
122 return $this;
123 }
124
130 {
131 $this->additionalParameters = $additionalParameters;
132 return $this;
133 }
134}
setAdditionalParameter(string $param, $value, ?bool $storeAsDefault=false)
Definition renderer.php:88
setUserField(array $userField)
Definition renderer.php:119
setAdditionalParameters(?array $additionalParameters)
Definition renderer.php:129
__construct(array $userField, ?array $additionalParameters=[])
Definition renderer.php:32
getAdditionalParameter(string $param)
Definition renderer.php:102