Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
orderidnumbergenerator.php
1<?php
3
8
14{
15 protected $orderId;
16
17 const TEMPLATE_WORD_ORDER_ID = "ORDER_ID";
18
20 public static function getTemplateWordsForParse()
21 {
22 return [
23 static::getPatternFor(static::TEMPLATE_WORD_ORDER_ID),
24 ];
25 }
26
28 public static function getTemplateWordsSettings()
29 {
30 return [
31 static::getPatternFor(static::TEMPLATE_WORD_ORDER_ID)
32 => Loc::getMessage('BITRIX_SALE_INTEGRATION_NUMERATOR_ORDERIDNUMBERGENERATOR_WORD_ORDER_ID'),
33 ];
34 }
35
39 public static function getAvailableForType()
40 {
42 }
43
45 public function parseTemplate($template)
46 {
47 if (!is_null($this->orderId))
48 {
49 return str_replace(self::getPatternFor(static::TEMPLATE_WORD_ORDER_ID), $this->orderId, $template);
50 }
51 return $template;
52 }
53
57 public function setDynamicConfig($config)
58 {
59 if (is_array($config) && array_key_exists('ORDER_ID', $config))
60 {
61 $this->orderId = $config['ORDER_ID'];
62 }
63 }
64}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29