1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
base.php
См. документацию.
1<?php
9
10use \Bitrix\Sender\Connector;
11
12abstract class Base
13{
14 protected $fieldPrefix;
15 protected $fieldValues;
16 protected $fieldFormName;
17 protected $moduleId;
18 protected $siteId;
19
20 protected $fields;
21 protected $params;
22 protected $isRunForOldData = false;
23 protected $recipient;
24
25
30 public function setModuleId($moduleId)
31 {
32 $this->moduleId = $moduleId;
33 }
34
38 public function getModuleId()
39 {
40 return $this->moduleId;
41 }
42
47 public function setSiteId($siteId)
48 {
49 $this->siteId = $siteId;
50 }
51
55 public function getSiteId()
56 {
57 return $this->siteId;
58 }
59
63 public function getId()
64 {
65 return $this->getModuleId().'_'.$this->getCode();
66 }
67
71 public function requireConfigure()
72 {
73 return false;
74 }
75
79 public static function isClosed()
80 {
81 return false;
82 }
83
87 public static function canBeTarget()
88 {
89 return true;
90 }
91
95 public static function canRunForOldData()
96 {
97 return false;
98 }
99
104 {
105 if(!static::canRunForOldData())
106 {
107 $this->isRunForOldData = false;
108 }
109
110 $this->isRunForOldData = (bool) $isRunForOldData;
111 }
112
116 public function isRunForOldData()
117 {
118 if(!$this->canRunForOldData())
119 {
120 return false;
121 }
122
123 return $this->isRunForOldData;
124 }
125
130 public function setFields(array $fieldValues = null)
131 {
132 $this->fields = $fieldValues;
133 }
134
138 public function getFields()
139 {
140 if(is_array($this->fields))
141 return $this->fields;
142 else
143 return array();
144 }
145
151 public function getFieldValue($name, $defaultValue = null)
152 {
153 if($this->fields && array_key_exists($name, $this->fields))
154 {
155 return $this->fields[$name];
156 }
157 else
158 {
159 return $defaultValue;
160 }
161 }
162
167 public function setParams(array $fieldValues = null)
168 {
169 $this->params = $fieldValues;
170 }
171
175 public function getParams()
176 {
177 if(is_array($this->params))
178 return $this->params;
179 else
180 return array();
181 }
182
188 public function getParam($name, $defaultValue = null)
189 {
190 if($this->params && array_key_exists($name, $this->params))
191 {
192 return $this->params[$name];
193 }
194 else
195 {
196 return $defaultValue;
197 }
198 }
199
205 {
206 $this->fieldFormName = $fieldFormName;
207 }
208
212 public function getFieldFormName()
213 {
215 }
216
222 {
223 $this->fieldPrefix = $fieldPrefix;
224 }
225
229 public function getFieldPrefix()
230 {
231 return $this->fieldPrefix;
232 }
233
238 public function getFieldId($id)
239 {
240 $fieldPrefix = $this->getFieldPrefix();
241 if($fieldPrefix)
242 {
243 return $fieldPrefix . '_' . $id;
244 }
245 else
246 return $id;
247 }
248
253 public function getFieldName($name)
254 {
255 $fieldPrefix = $this->getFieldPrefix();
256 if($fieldPrefix)
257 {
258 $returnName = array();
259 $returnName[] = $fieldPrefix;
260 $nameParsed = explode('[', $name);
261 $returnName[] = '['.$nameParsed[0].']';
262 if(count($nameParsed) > 1)
263 {
264 unset($nameParsed[0]);
265 $returnName[] = '['.implode('[', $nameParsed);
266 }
267
268 return implode('', $returnName);
269 }
270 else
271 return $name;
272 }
273
277 public function getFullEventType()
278 {
279 return $this->getEventModuleId() .'/'. $this->getEventType();
280 }
281
282
284 public function getMailEventToPrevent()
285 {
286 return array(
287 'EVENT_NAME' => '',
288 'FILTER' => array()
289 );
290 }
291
293 public function filter()
294 {
295 return true;
296 }
297
301 public function getForm()
302 {
303 return '';
304 }
305
309 public function getRecipientResult()
310 {
311 $result = new Connector\Result($this->getRecipient());
312
313 // set fields that will be added in each item of result set
314 $personalizeList = array();
315 $personalizeListTmp = $this->getPersonalizeList();
316 foreach($personalizeListTmp as $tag)
317 {
318 if($tag['CODE'] <> '')
319 {
320 $personalizeList[] = $tag['CODE'];
321 }
322 }
323 $result->setFilterFields($personalizeList);
324
325 // set same fields for all items in each item of result set
326 $result->setAdditionalFields($this->getPersonalizeFields());
327
328 return $result;
329 }
330
334 public function getPersonalizeFields()
335 {
336 return array();
337 }
338
342 public static function getPersonalizeList()
343 {
344 return array();
345 }
346
350 public abstract function getName();
351
355 public abstract function getCode();
356
360 public abstract function getEventModuleId();
361
365 public abstract function getEventType();
366
370 public abstract function getRecipient();
371}
if($_SERVER $defaultValue['REQUEST_METHOD']==="GET" &&!empty($RestoreDefaults) && $bizprocPerms==="W" &&check_bitrix_sessid())
Определения options.php:32
Определения result.php:20
$fieldFormName
Определения base.php:17
$fieldPrefix
Определения base.php:14
getFieldPrefix()
Определения base.php:89
getModuleId()
Определения base.php:39
static getPersonalizeList()
Определения base.php:337
static isClosed()
Определения base.php:79
getId()
Определения base.php:63
setFields(array $fieldValues=null)
Определения base.php:130
$isRunForOldData
Определения base.php:22
setSiteId($siteId)
Определения base.php:47
getFieldName($name)
Определения base.php:253
$fieldFormName
Определения base.php:16
$fieldPrefix
Определения base.php:14
getSiteId()
Определения base.php:55
getPersonalizeFields()
Определения base.php:334
$fieldValues
Определения base.php:15
static canRunForOldData()
Определения base.php:95
getForm()
Определения base.php:301
setFieldPrefix($fieldPrefix)
Определения base.php:221
setModuleId($moduleId)
Определения base.php:30
getFieldFormName()
Определения base.php:212
filter()
Определения base.php:293
setParams(array $fieldValues=null)
Определения base.php:167
setFieldFormName($fieldFormName)
Определения base.php:204
getRecipientResult()
Определения base.php:309
$siteId
Определения base.php:18
$fields
Определения base.php:20
getFieldPrefix()
Определения base.php:229
getParam($name, $defaultValue=null)
Определения base.php:188
getModuleId()
Определения base.php:38
$moduleId
Определения base.php:17
isRunForOldData()
Определения base.php:116
getFieldId($id)
Определения base.php:238
requireConfigure()
Определения base.php:71
$recipient
Определения base.php:23
static getPersonalizeList()
Определения base.php:342
getFieldValue($name, $defaultValue=null)
Определения base.php:151
static canBeTarget()
Определения base.php:87
getParams()
Определения base.php:175
getMailEventToPrevent()
Определения base.php:284
getFullEventType()
Определения base.php:277
$params
Определения base.php:21
setRunForOldData($isRunForOldData)
Определения base.php:103
getFields()
Определения base.php:138
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$siteId
Определения ajax.php:8
$name
Определения menu_edit.php:35
Определения base.php:8
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$fields
Определения yandex_run.php:501