1 | <?php |
||
11 | class Connection |
||
12 | { |
||
13 | /** @var string */ |
||
14 | private $host; |
||
15 | |||
16 | /** @var string */ |
||
17 | private $port; |
||
18 | |||
19 | /** @var string */ |
||
20 | private $user; |
||
21 | |||
22 | /** @var string */ |
||
23 | private $password; |
||
24 | |||
25 | /** @var string */ |
||
26 | private $databaseName; |
||
27 | |||
28 | /** @var PDO */ |
||
29 | private $currentConnection; |
||
30 | |||
31 | /** @var string */ |
||
32 | private $provisioningTable; |
||
33 | |||
34 | /** @var string */ |
||
35 | private $criteriaColumn; |
||
36 | |||
37 | private $dsn; |
||
38 | |||
39 | |||
40 | /** |
||
41 | * @param string $host |
||
42 | * @return $this |
||
43 | */ |
||
44 | public function setHost($host) |
||
50 | |||
51 | |||
52 | |||
53 | /** |
||
54 | * @param string $port |
||
55 | * @return $this |
||
56 | */ |
||
57 | public function setPort($port) |
||
63 | |||
64 | |||
65 | |||
66 | /** |
||
67 | * @param string $user |
||
68 | * @return $this |
||
69 | */ |
||
70 | public function setUser($user) |
||
76 | |||
77 | |||
78 | |||
79 | /** |
||
80 | * @param string $password |
||
81 | * @return $this |
||
82 | */ |
||
83 | public function setPassword($password) |
||
89 | |||
90 | |||
91 | |||
92 | /** |
||
93 | * @param string $databaseName |
||
94 | * @return $this |
||
95 | */ |
||
96 | public function setDatabaseName($databaseName) |
||
102 | |||
103 | |||
104 | |||
105 | /** |
||
106 | * @param bool $useMemoryStorage |
||
107 | * @return $this |
||
108 | */ |
||
109 | 1 | public function useSqlite($useMemoryStorage = false) |
|
115 | |||
116 | |||
117 | |||
118 | /** |
||
119 | * @return $this |
||
120 | */ |
||
121 | 1 | public function useMysql() |
|
127 | |||
128 | /** |
||
129 | * @return PDO |
||
130 | */ |
||
131 | 1 | public function getCurrentConnection() |
|
146 | |||
147 | |||
148 | |||
149 | /** |
||
150 | * @param string $provisioningTable |
||
151 | * @return $this |
||
152 | */ |
||
153 | 1 | public function setProvisioningTable($provisioningTable) |
|
159 | |||
160 | |||
161 | |||
162 | /** |
||
163 | * @param string $criteriaColumn |
||
164 | * @return $this |
||
165 | */ |
||
166 | 1 | public function setCriteriaColumn($criteriaColumn) |
|
172 | |||
173 | |||
174 | |||
175 | /** |
||
176 | * @return string |
||
177 | */ |
||
178 | public function getProvisioningTable() |
||
182 | |||
183 | |||
184 | |||
185 | /** |
||
186 | * @return string |
||
187 | */ |
||
188 | public function getCriteriaColumn() |
||
192 | } |
||
193 |