Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
shipmentpropertyvalue.php
1<?php
2
3namespace Bitrix\Sale;
4
6
12{
17 protected static function getOnSavedEventName(): string
18 {
19 return 'OnSaleShipmentPropertyValueEntitySaved';
20 }
21
25 protected static function getPropertyClassName(): string
26 {
27 $registry = Registry::getInstance(static::getRegistryType());
28 return $registry->getShipmentPropertyClassName();
29 }
30
34 protected static function getEntityType(): string
35 {
36 return \Bitrix\Sale\Registry::ENTITY_SHIPMENT;
37 }
38
43 protected static function extractDeliveryIdList(Entity $shipment)
44 {
45 if (!$shipment instanceof Shipment)
46 {
47 return [];
48 }
49
50 return [$shipment->getDeliveryId()];
51 }
52
53 protected static function extractTpLandingIdList(Entity $entity) : array
54 {
55 if (!$entity instanceof Shipment)
56 {
57 return [];
58 }
59
60 return $entity->getOrder()->getTradeBindingCollection()->getTradingPlatformIdList();
61 }
62
63 protected static function extractTradingPlatformIdList(Entity $entity): array
64 {
65 if (!$entity instanceof Shipment)
66 {
67 return [];
68 }
69
70 return $entity->getOrder()->getTradeBindingCollection()->getTradingPlatformIdList();
71 }
72
80 protected static function createPropertyValueObject(
81 array $property = null,
82 array $value = [], array
83 $relation = null
85 {
86 $registry = Registry::getInstance(static::getRegistryType());
87 $propertyValueClassName = $registry->getShipmentPropertyValueClassName();
88 return new $propertyValueClassName($property, $value, $relation);
89 }
90
95 public static function loadForShipment(Shipment $shipment): array
96 {
97 [$properties, $propertyValues, $propRelation, $propertyValuesMap] = static::loadFromDb($shipment);
98 return static::createPropertyValuesObjects($properties, $propertyValues, $propRelation, $propertyValuesMap);
99 }
100
104 public static function getEntityEventName()
105 {
106 return 'SaleShipmentPropertyValue';
107 }
108}
static getInstance($type)
Definition registry.php:183
static loadForShipment(Shipment $shipment)
static extractTpLandingIdList(Entity $entity)
static extractDeliveryIdList(Entity $shipment)
static createPropertyValueObject(array $property=null, array $value=[], array $relation=null)
static extractTradingPlatformIdList(Entity $entity)