1 | <?php |
||
24 | abstract class IntegrationConnections extends Component |
||
25 | { |
||
26 | /** |
||
27 | * The app connection handle |
||
28 | */ |
||
29 | const CONNECTION = 'app'; |
||
30 | |||
31 | /** |
||
32 | * The default connection identifier |
||
33 | */ |
||
34 | const DEFAULT_CONNECTION = 'DEFAULT'; |
||
35 | |||
36 | /** |
||
37 | * The override file |
||
38 | */ |
||
39 | public $overrideFile; |
||
40 | |||
41 | /** |
||
42 | * @var array|null |
||
43 | */ |
||
44 | private $overrides; |
||
45 | |||
46 | /** |
||
47 | * @var array |
||
48 | */ |
||
49 | private $connections = []; |
||
50 | |||
51 | /** |
||
52 | * @var array |
||
53 | */ |
||
54 | private $enabled = []; |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | abstract protected static function tableName(): string; |
||
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | abstract protected static function connectionInstance(): string; |
||
65 | |||
66 | /** |
||
67 | * Load override cache configurations |
||
68 | */ |
||
69 | protected function loadOverrides() |
||
79 | |||
80 | /** |
||
81 | * Returns any configurations from the config file. |
||
82 | * |
||
83 | * @param string $handle |
||
84 | * @return array|null |
||
85 | */ |
||
86 | public function getOverrides(string $handle) |
||
91 | |||
92 | /** |
||
93 | * @return string |
||
94 | */ |
||
95 | protected function getDefaultConnection(): string |
||
99 | |||
100 | /** |
||
101 | * @param string $handle |
||
102 | * @throws ConnectionNotFound |
||
103 | */ |
||
104 | protected function handleCacheNotFound(string $handle) |
||
113 | |||
114 | /** |
||
115 | * @param string $handle |
||
116 | * @param bool $enabledOnly |
||
117 | * @return mixed|null |
||
118 | */ |
||
119 | public function find( |
||
159 | |||
160 | /** |
||
161 | * @param string $handle |
||
162 | * @param bool $enabledOnly |
||
163 | * @return mixed |
||
164 | * @throws ConnectionNotFound |
||
165 | */ |
||
166 | public function get( |
||
176 | |||
177 | /** |
||
178 | * @param $config |
||
179 | * @return mixed|null |
||
180 | */ |
||
181 | protected function create(array $config) |
||
204 | } |
||
205 |