Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
converterfactory.php
1<?php
3
12
14{
21 public static function create($typeId)
22 {
23 if(!is_int($typeId))
24 {
25 $typeId = (int)$typeId;
26 }
27
28 if(!EntityType::IsDefined($typeId))
29 {
31 }
32
33 if ($typeId === EntityType::ORDER)
34 {
35 return new ConverterDocumentInvoice();
36 }
37 elseif ($typeId === EntityType::SHIPMENT)
38 {
40 }
41 elseif(
42 $typeId === EntityType::PAYMENT_CASH ||
45 {
47 }
48 elseif($typeId == EntityType::PROFILE ||
49 $typeId == EntityType::USER_PROFILE)
50 {
51 return new ConverterDocumentProfile();
52 }
53 else
54 {
55 throw new NotSupportedException("Entity type: '".DocumentType::ResolveName($typeId)."' is not supported in current context");
56 }
57 }
58}