1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
shipmentpropertyvaluecollection.php
См. документацию.
1<?php
2
3namespace Bitrix\Sale;
4
10{
12 protected $shipment;
13
18 protected static function getOnValueDeletedEventName(): string
19 {
20 return 'OnSaleShipmentPropertyValueDeleted';
21 }
22
27 protected static function getOnBeforeValueDeletedEventName(): string
28 {
29 return 'OnBeforeSaleShipmentPropertyValueDeleted';
30 }
31
35 protected static function getPropertyClassName(): string
36 {
37 $registry = Registry::getInstance(static::getRegistryType());
38 return $registry->getShipmentPropertyClassName();
39 }
40
44 protected function getEntityParent()
45 {
46 return $this->shipment;
47 }
48
52 protected static function getEntityType(): string
53 {
54 return \Bitrix\Sale\Registry::ENTITY_SHIPMENT;
55 }
56
61 protected static function getPropertyValueClassName(): string
62 {
63 $registry = Registry::getInstance(static::getRegistryType());
64 return $registry->getShipmentPropertyValueClassName();
65 }
66
71 public static function load(Shipment $shipment): ShipmentPropertyValueCollection
72 {
73 $propertyCollection = static::createPropertyValueCollectionObject();
74 $propertyCollection->setShipment($shipment);
75
77 $propertyValueClassName = static::getPropertyValueClassName();
78
79 $props = $propertyValueClassName::loadForEntity($shipment);
80
82 foreach ($props as $prop)
83 {
84 $prop->setCollection($propertyCollection);
85 $propertyCollection->bindItem($prop);
86 }
87
88 return $propertyCollection;
89 }
90
94 public function getOrder()
95 {
96 return $this->shipment->getOrder();
97 }
98
102 private static function createPropertyValueCollectionObject()
103 {
104 $registry = Registry::getInstance(static::getRegistryType());
105 $propertyValueCollectionClassName = $registry->getShipmentPropertyValueCollectionClassName();
106 return new $propertyValueCollectionClassName();
107 }
108
112 protected function setShipment(Shipment $shipment)
113 {
114 $this->shipment = $shipment;
115 }
116}
static getInstance($type)
Определения registry.php:183
$props
Определения template.php:269