Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
entityimportfactory.php
1<?php
3
6
13{
21 public static function create($entityTypeID, $parentEntityContext = null)
22 {
23 if(!is_int($entityTypeID))
24 {
25 $entityTypeID = (int)$entityTypeID;
26 }
27
28 if(!Exchange\EntityType::IsDefined($entityTypeID))
29 {
31 }
32
33 if($entityTypeID === Exchange\EntityType::ORDER)
34 {
36 }
37 elseif($entityTypeID === Exchange\EntityType::SHIPMENT)
38 {
39 return new Exchange\Entity\SubordinateSale\Shipment($parentEntityContext);
40 }
41 elseif($entityTypeID === Exchange\EntityType::PAYMENT_CASH)
42 {
43 return new Exchange\Entity\PaymentCashImport($parentEntityContext);
44 }
45 elseif($entityTypeID === Exchange\EntityType::PAYMENT_CASH_LESS)
46 {
47 return new Exchange\Entity\PaymentCashLessImport($parentEntityContext);
48 }
49 elseif($entityTypeID === Exchange\EntityType::PAYMENT_CARD_TRANSACTION)
50 {
51 return new Exchange\Entity\PaymentCardImport($parentEntityContext);
52 }
53 elseif($entityTypeID === Exchange\EntityType::USER_PROFILE)
54 {
56 }
57 else
58 {
59 throw new Main\NotSupportedException("Entity type: '".Exchange\EntityType::ResolveName($entityTypeID)."' is not supported in current context");
60 }
61 }
62}
static create($entityTypeID, $parentEntityContext=null)