1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
base.php
См. документацию.
1<?php
3
7use Bitrix\Sale\Order;
9
10abstract class Base
11{
12 protected $fields;
13
14 public function __construct(array $values = null)
15 {
16 $this->fields = new Fields($values);
17 }
18
19 public function getId()
20 {
21 return $this->fields->get('ID');
22 }
23 public function setId($value)
24 {
25 $this->fields->set('ID', $value);
26 return $this;
27 }
28
29 public function getFieldsValues()
30 {
31 return $this->fields->getValues();
32 }
33
34 abstract public function getType();
35 abstract static protected function resolveFields(array $list);
36 abstract static public function createFromArray(array $fields);
37
38 public function load(Order $order)
39 {
42 $orderClass = $registry->getOrderClassName();
43 $list = $orderClass::getList([
44 'select'=>[
45 'ID',
46 'PROPERTY.CODE',
47 'PROPERTY.VALUE',
48 'USER.ID',
49 'USER.NAME',
50 'USER.LAST_NAME',
51 'USER.EMAIL',
52 'USER.PERSONAL_PHONE',
53 'PERSON_TYPE_ID'
54 ],
55 'filter'=>['ID'=>$order->getId()]
56 ])->fetchAll();
57
58 if(count($list)>0)
59 {
60 $fields = static::resolveFields($list);
61 return static::createFromArray($fields);
62 }
63 else
64 {
65 throw new Exception\UserException('Client not loaded');
66 }
67 }
68
69 static public function resolveNamePersonDomain($personTypeId)
70 {
71 static $list = null;
72
73 if ($list == null)
74 {
75 $list = static::businessValuePersonDomainList();
76 }
77
78 if (isset($list[$personTypeId]))
79 {
80 return $list[$personTypeId];
81 }
82 else
83 {
84 throw new Exception\UserException("Person personTypeId: '".$personTypeId."' is not supported in current context");
85 }
86 }
87 static protected function businessValuePersonDomainList()
88 {
89 $bzList = [];
90 foreach (BusinessValuePersonDomainTable::getList()->fetchAll() as $bz)
91 {
92 $bzList[$bz['PERSON_TYPE_ID']] = $bz['DOMAIN'];
93 }
94
95 return $bzList;
96 }
97}
__construct(array $values=null)
Определения base.php:14
static resolveNamePersonDomain($personTypeId)
Определения base.php:69
static getInstance($type)
Определения registry.php:183
const REGISTRY_TYPE_ORDER
Определения registry.php:16
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$order
Определения payment.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