1 | <?php |
||
21 | class HubSpot |
||
22 | { |
||
23 | use StaticLoggerTrait; |
||
24 | |||
25 | /** |
||
26 | * @var CacheInterface |
||
27 | */ |
||
28 | private static $cache; |
||
29 | |||
30 | /** |
||
31 | * @var ConnectionInterface |
||
32 | */ |
||
33 | private static $connection; |
||
34 | |||
35 | /** |
||
36 | * @var IntegrationConnectionInterface |
||
37 | */ |
||
38 | private static $integrationConnection; |
||
39 | |||
40 | /** |
||
41 | * @var LoggerInterface |
||
42 | */ |
||
43 | private static $logger; |
||
44 | |||
45 | |||
46 | /******************************************* |
||
47 | * LOGGER |
||
48 | *******************************************/ |
||
49 | |||
50 | /** |
||
51 | * Get a logger |
||
52 | * |
||
53 | * @return LoggerInterface|null |
||
54 | */ |
||
55 | public static function getLogger() |
||
59 | |||
60 | /** |
||
61 | * Set a logger |
||
62 | * |
||
63 | * @param LoggerInterface|null $logger |
||
64 | */ |
||
65 | public static function setLogger(LoggerInterface $logger = null) |
||
69 | |||
70 | /** |
||
71 | * Logs with an arbitrary level. |
||
72 | * |
||
73 | * @param mixed $level |
||
74 | * @param string $message |
||
75 | * @param array $context |
||
76 | * |
||
77 | */ |
||
78 | public static function log($level, $message, array $context = []) |
||
84 | |||
85 | |||
86 | /******************************************* |
||
87 | * CACHE |
||
88 | *******************************************/ |
||
89 | |||
90 | /** |
||
91 | * Get the cache |
||
92 | * |
||
93 | * @return CacheInterface |
||
94 | */ |
||
95 | public static function getCache(): CacheInterface |
||
99 | |||
100 | /** |
||
101 | * Set the cache |
||
102 | * |
||
103 | * @param CacheInterface $cache |
||
104 | */ |
||
105 | public static function setCache(CacheInterface $cache) |
||
109 | |||
110 | |||
111 | /******************************************* |
||
112 | * CONNECTION |
||
113 | *******************************************/ |
||
114 | |||
115 | /** |
||
116 | * Get the connection |
||
117 | * |
||
118 | * @return ConnectionInterface |
||
119 | */ |
||
120 | public static function getConnection(): ConnectionInterface |
||
124 | |||
125 | /** |
||
126 | * Set the connection |
||
127 | * |
||
128 | * @param ConnectionInterface $connection |
||
129 | */ |
||
130 | public static function setConnection(ConnectionInterface $connection) |
||
134 | |||
135 | |||
136 | /******************************************* |
||
137 | * INTEGRATION CONNECTION |
||
138 | *******************************************/ |
||
139 | |||
140 | /** |
||
141 | * Get the integration connection |
||
142 | * |
||
143 | * @return IntegrationConnectionInterface |
||
144 | */ |
||
145 | public static function getIntegrationConnection(): IntegrationConnectionInterface |
||
149 | |||
150 | /** |
||
151 | * Set the integration connection |
||
152 | * |
||
153 | * @param IntegrationConnectionInterface $integrationConnection |
||
154 | */ |
||
155 | public static function setIntegrationConnection(IntegrationConnectionInterface $integrationConnection) |
||
159 | } |
||
160 |