Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
managerbase.php
1<?php
2
4
5
11use Bitrix\Sale\Exchange\ProviderType\ProviderType;
12
13abstract class ManagerBase
14{
17
18 protected static $instance = null;
20 protected $settings = null;
22 protected $logger = null;
23
28 static public function getDirectionType()
29 {
30 throw new NotImplementedException('The method is not implemented.');
31 }
32
36 private static function getInstance()
37 {
38 if(self::$instance === null)
39 {
40 self::$instance = new static();
41 }
42 return self::$instance;
43 }
44
51 static protected function getImportByType($typeId)
52 {
53 static::IsDefinedTypeId($typeId);
54
55 $import = static::getInstance();
56 return isset($import[$typeId]) ? $import[$typeId] : null;
57 }
58
63 static public function configure(ImportBase $entity)
64 {
65 throw new NotImplementedException('The method is not implemented.');
66 }
67
72 static public function deleteLoggingDate()
73 {
74 (new Exchange(Logger\ProviderType::ONEC_NAME))
75 ->deleteOldRecords(static::getDirectionType(), LoggerDiag::getInterval());
76 }
77
78 static protected function IsDefinedTypeId($typeId)
79 {
80 if(!is_int($typeId))
81 {
82 $typeId = (int)$typeId;
83 }
84
85 if(!EntityType::IsDefined($typeId))
86 {
88 }
89 }
90}
static configure(ImportBase $entity)