1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
managerbase.php
См. документацию.
1<?php
2
3namespace Bitrix\Sale\Exchange;
4
5
6use Bitrix\Main\ArgumentOutOfRangeException;
7use Bitrix\Main\NotImplementedException;
8use Bitrix\Sale\Exchange\Internals\ExchangeLogTable;
9use Bitrix\Sale\Exchange\Internals\LoggerDiag;
10use Bitrix\Sale\Exchange\Logger\Exchange;
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}
const EXCHANGE_DIRECTION_EXPORT
Определения managerbase.php:16
static IsDefinedTypeId($typeId)
Определения managerbase.php:78
static configure(ImportBase $entity)
Определения managerbase.php:63
static getDirectionType()
Определения managerbase.php:28
static deleteLoggingDate()
Определения managerbase.php:72
const EXCHANGE_DIRECTION_IMPORT
Определения managerbase.php:15
static getImportByType($typeId)
Определения managerbase.php:51
$entity