Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
factory.php
1<?php
2
4
5class Factory
6{
7 private static ?Section $sectionInstance = null;
8 private static ?Event $eventInstance = null;
9 private static ?SectionConnection $sectionConnectionInstance = null;
10 private static ?EventConnection $eventConnectionInstance = null;
11 private static ?SyncEvent $syncEventInstance = null;
12 private static ?Connection $connectionInstance = null;
13
14 public function getSection(): Section
15 {
16 if (!self::$sectionInstance)
17 {
18 self::$sectionInstance = new Section();
19 }
20
21 return self::$sectionInstance;
22 }
23
24
25 public function getEvent(): Event
26 {
27 if (!self::$eventInstance)
28 {
29 self::$eventInstance = new Event();
30 }
31
32 return self::$eventInstance;
33 }
34
36 {
37 if (!self::$sectionConnectionInstance)
38 {
39 self::$sectionConnectionInstance = new SectionConnection();
40 }
41
42 return self::$sectionConnectionInstance;
43 }
44
45
47 {
48 if (!self::$eventConnectionInstance)
49 {
50 self::$eventConnectionInstance = new EventConnection();
51 }
52
53 return self::$eventConnectionInstance;
54 }
55
56 public function getSyncEvent(): SyncEvent
57 {
58 if (!self::$syncEventInstance)
59 {
60 self::$syncEventInstance = new SyncEvent();
61 }
62
63 return self::$syncEventInstance;
64 }
65
66 public function getConnection(): Connection
67 {
68 if (!self::$connectionInstance)
69 {
70 self::$connectionInstance = new Connection();
71 }
72
73 return self::$connectionInstance;
74 }
75}