Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
shipmentpropertyvalue.php
1
<?php
2
3
namespace
Bitrix\Sale
;
4
5
use
Bitrix\Sale\Internals\Entity
;
6
11
class
ShipmentPropertyValue
extends
EntityPropertyValue
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
84
):
EntityPropertyValue
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
}
Bitrix\Catalog\Model\Entity
Definition
entity.php:12
Bitrix\Sale\EntityPropertyValue
Definition
entitypropertyvalue.php:18
Bitrix\Sale\EntityPropertyValue\$property
$property
Definition
entitypropertyvalue.php:20
Bitrix\Sale\Registry\getInstance
static getInstance($type)
Definition
registry.php:183
Bitrix\Sale\Shipment
Definition
shipment.php:21
Bitrix\Sale\ShipmentPropertyValue
Definition
shipmentpropertyvalue.php:12
Bitrix\Sale\ShipmentPropertyValue\getOnSavedEventName
static getOnSavedEventName()
Definition
shipmentpropertyvalue.php:17
Bitrix\Sale\ShipmentPropertyValue\loadForShipment
static loadForShipment(Shipment $shipment)
Definition
shipmentpropertyvalue.php:95
Bitrix\Sale\ShipmentPropertyValue\extractTpLandingIdList
static extractTpLandingIdList(Entity $entity)
Definition
shipmentpropertyvalue.php:53
Bitrix\Sale\ShipmentPropertyValue\getEntityType
static getEntityType()
Definition
shipmentpropertyvalue.php:34
Bitrix\Sale\ShipmentPropertyValue\getEntityEventName
static getEntityEventName()
Definition
shipmentpropertyvalue.php:104
Bitrix\Sale\ShipmentPropertyValue\extractDeliveryIdList
static extractDeliveryIdList(Entity $shipment)
Definition
shipmentpropertyvalue.php:43
Bitrix\Sale\ShipmentPropertyValue\createPropertyValueObject
static createPropertyValueObject(array $property=null, array $value=[], array $relation=null)
Definition
shipmentpropertyvalue.php:80
Bitrix\Sale\ShipmentPropertyValue\getPropertyClassName
static getPropertyClassName()
Definition
shipmentpropertyvalue.php:25
Bitrix\Sale\ShipmentPropertyValue\extractTradingPlatformIdList
static extractTradingPlatformIdList(Entity $entity)
Definition
shipmentpropertyvalue.php:63
Bitrix\Sale
modules
sale
lib
shipmentpropertyvalue.php
Создано системой
1.10.0