Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
propertyvaluebase.php
1<?php
2
3namespace Bitrix\Sale;
4
7
13{
18 protected static function getOnSavedEventName(): string
19 {
20 return 'OnSalePropertyValueEntitySaved';
21 }
22
26 protected static function getPropertyClassName(): string
27 {
28 $registry = Registry::getInstance(static::getRegistryType());
29 return $registry->getPropertyClassName();
30 }
31
35 protected static function getEntityType(): string
36 {
37 return \Bitrix\Sale\Registry::ENTITY_ORDER;
38 }
39
40
45 public static function loadForOrder(OrderBase $order): array
46 {
47 return static::loadForEntity($order);
48 }
49
56 protected static function createPropertyValueObject(
57 array $property = null,
58 array $value = [],
59 array $relation = null
61 {
62 $registry = Registry::getInstance(static::getRegistryType());
63 $propertyValueClassName = $registry->getPropertyValueClassName();
64 return new $propertyValueClassName($property, $value, $relation);
65 }
66
71 protected static function extractPaySystemIdList(Entity $order)
72 {
73 return [$order->getField('PAY_SYSTEM_ID')];
74 }
75
80 protected static function extractDeliveryIdList(Entity $order)
81 {
82 return [(int)$order->getField('DELIVERY_ID')];
83 }
84
95 public static function loadOptions($propertyId)
96 {
97 $registry = Registry::getInstance(static::getRegistryType());
98
100 $propertyClassName = $registry->getPropertyClassName();
101 $property = $propertyClassName::getObjectById($propertyId);
102
103 if ($property)
104 {
105 return $property->getOptions();
106 }
107
108 return [];
109 }
110
123 public static function getMeaningfulValues($personTypeId, $request)
124 {
125 $registry = Registry::getInstance(static::getRegistryType());
126
128 $propertyClassName = $registry->getPropertyClassName();
129 return $propertyClassName::getMeaningfulValues($personTypeId, $request);
130 }
131
137 public static function getEntityEventName()
138 {
139 return 'SalePropertyValue';
140 }
141}
static loadForOrder(OrderBase $order)
static extractDeliveryIdList(Entity $order)
static extractPaySystemIdList(Entity $order)
static createPropertyValueObject(array $property=null, array $value=[], array $relation=null)
static getInstance($type)
Definition registry.php:183