Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
storedocumenttablemanager.php
1<?php
2
4
12
14{
15 private static $typeClassMap = [
16 StoreDocumentTable::TYPE_ARRIVAL => StoreDocumentArrivalTable::class,
17 StoreDocumentTable::TYPE_STORE_ADJUSTMENT => StoreDocumentStoreAdjustmentTable::class,
18 StoreDocumentTable::TYPE_MOVING => StoreDocumentMovingTable::class,
19 StoreDocumentTable::TYPE_DEDUCT => StoreDocumentDeductTable::class,
20 StoreDocumentTable::TYPE_RETURN => StoreDocumentReturnTable::class,
21 StoreDocumentTable::TYPE_UNDO_RESERVE => StoreDocumentUndoReserveTable::class,
22 ];
23
28 public static function getTableClassByType(string $docType): string
29 {
30 return self::$typeClassMap[$docType] ?? '';
31 }
32
36 public static function getUfEntityIds(): array
37 {
38 return array_map(static fn($tableClass): string => $tableClass::getUfId(), self::$typeClassMap);
39 }
40
45 public static function getTypeByUfId(string $entityId): string
46 {
47 $map = array_flip(self::getUfEntityIds());
48
49 return $map[$entityId] ?? '';
50 }
51}