1 | <?php |
||
36 | class Database implements DatabaseConfigurationInterface |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * The database identifier for this database connection. |
||
41 | * |
||
42 | * @var string |
||
43 | * @Type("string") |
||
44 | * @SerializedName("id") |
||
45 | */ |
||
46 | protected $id; |
||
47 | |||
48 | /** |
||
49 | * The PDO DSN to use. |
||
50 | * |
||
51 | * @var string |
||
52 | * @Type("string") |
||
53 | * @SerializedName("pdo-dsn") |
||
54 | */ |
||
55 | protected $dsn; |
||
56 | |||
57 | /** |
||
58 | * The database host to use. |
||
59 | * |
||
60 | * @var string |
||
61 | * @Type("string") |
||
62 | */ |
||
63 | protected $host; |
||
64 | |||
65 | /** |
||
66 | * The database port to use. |
||
67 | * |
||
68 | * @var string |
||
69 | * @Type("integer") |
||
70 | */ |
||
71 | protected $port; |
||
72 | |||
73 | /** |
||
74 | * The DB username to use. |
||
75 | * |
||
76 | * @var string |
||
77 | * @Type("string") |
||
78 | */ |
||
79 | protected $username; |
||
80 | |||
81 | /** |
||
82 | * The DB password to use. |
||
83 | * |
||
84 | * @var string |
||
85 | * @Type("string") |
||
86 | */ |
||
87 | protected $password; |
||
88 | |||
89 | /** |
||
90 | * The flag to signal the default datasource or not. |
||
91 | * |
||
92 | * @var boolean |
||
93 | * @Type("boolean") |
||
94 | * @SerializedName("default") |
||
95 | */ |
||
96 | protected $default = false; |
||
97 | |||
98 | /** |
||
99 | * The DB timeout to use. |
||
100 | * |
||
101 | * @var integer |
||
102 | * @Type("integer") |
||
103 | */ |
||
104 | protected $timeout; |
||
105 | |||
106 | /** |
||
107 | * The DB version to use. |
||
108 | * |
||
109 | * @var string |
||
110 | * @Type("string") |
||
111 | */ |
||
112 | protected $version; |
||
113 | |||
114 | /** |
||
115 | * The DB name to use. |
||
116 | * |
||
117 | * @var string |
||
118 | * @Type("string") |
||
119 | */ |
||
120 | protected $name; |
||
121 | |||
122 | /** |
||
123 | * The DB table prefix to use. |
||
124 | * |
||
125 | * @var string |
||
126 | * @Type("string") |
||
127 | * @SerializedName("table-prefix") |
||
128 | */ |
||
129 | protected $tablePrefix; |
||
130 | |||
131 | /** |
||
132 | * The DB type to use. |
||
133 | * |
||
134 | * @var string |
||
135 | * @Type("string") |
||
136 | */ |
||
137 | protected $type = DatabaseConfigurationInterface::TYPE_MYSQL; |
||
138 | |||
139 | /** |
||
140 | * Set's the database identifier for this database connection. |
||
141 | * |
||
142 | * @param string $id The database identifier |
||
143 | * |
||
144 | * @return void |
||
145 | */ |
||
146 | public function setId($id) |
||
150 | |||
151 | /** |
||
152 | * Return's the database identifier for this database connection. |
||
153 | * |
||
154 | * @return string The database identifier |
||
155 | */ |
||
156 | public function getId() |
||
160 | |||
161 | /** |
||
162 | * Set's the PDO DSN to use. |
||
163 | * |
||
164 | * @param string $dsn The PDO DSN |
||
165 | * |
||
166 | * @return void |
||
167 | */ |
||
168 | public function setDsn($dsn) |
||
172 | |||
173 | /** |
||
174 | * Return's the PDO DSN to use. |
||
175 | * |
||
176 | * @return string The PDO DSN |
||
177 | */ |
||
178 | public function getDsn() |
||
182 | |||
183 | /** |
||
184 | * Set's the DB username to use. |
||
185 | * |
||
186 | * @param string $username The DB username |
||
187 | * |
||
188 | * @return void |
||
189 | */ |
||
190 | public function setUsername($username) |
||
194 | |||
195 | /** |
||
196 | * Return's the DB username to use. |
||
197 | * |
||
198 | * @return string The DB username |
||
199 | */ |
||
200 | public function getUsername() |
||
204 | |||
205 | /** |
||
206 | * Set's the DB password to use. |
||
207 | * |
||
208 | * @param string $password The DB password |
||
209 | * |
||
210 | * @return void |
||
211 | */ |
||
212 | public function setPassword($password) |
||
216 | |||
217 | /** |
||
218 | * Return's the DB password to use. |
||
219 | * |
||
220 | * @return string The DB password |
||
221 | */ |
||
222 | public function getPassword() |
||
226 | |||
227 | /** |
||
228 | * Set's the flag to signal that this is the default datasource or not. |
||
229 | * |
||
230 | * @param boolean $default TRUE if this is the default datasource, else FALSE |
||
231 | * |
||
232 | * @return void |
||
233 | */ |
||
234 | public function setDefault($default) |
||
238 | |||
239 | /** |
||
240 | * Set's the DB table prefix to use. |
||
241 | * |
||
242 | * @param string $tablePrefix The DB table prefix |
||
243 | * |
||
244 | * @return void |
||
245 | */ |
||
246 | public function setTablePrefix($tablePrefix) |
||
250 | |||
251 | /** |
||
252 | * Return's the flag to signal that this is the default datasource or not. |
||
253 | * |
||
254 | * @return boolean TRUE if this is the default datasource, else FALSE |
||
255 | */ |
||
256 | public function isDefault() |
||
260 | |||
261 | /** |
||
262 | * Return's the DB name to use. |
||
263 | * |
||
264 | * @return string The DB name |
||
265 | */ |
||
266 | public function getName() |
||
270 | |||
271 | /** |
||
272 | * Return's the DB timeout to use. |
||
273 | * |
||
274 | * @return integer The DB timeout |
||
275 | */ |
||
276 | public function getTimeout() |
||
280 | |||
281 | /** |
||
282 | * Return's the DB version to use. |
||
283 | * |
||
284 | * @return string The DB version |
||
285 | */ |
||
286 | public function getVersion() |
||
290 | |||
291 | /** |
||
292 | * Return's the DB host to use. |
||
293 | * |
||
294 | * @return string The DB host |
||
295 | */ |
||
296 | public function getHost() |
||
300 | |||
301 | /** |
||
302 | * Return's the DB port to use. |
||
303 | * |
||
304 | * @return integer The DB port |
||
305 | */ |
||
306 | public function getPort() |
||
310 | |||
311 | /** |
||
312 | * Return's the DB type to use. |
||
313 | * |
||
314 | * @return string The DB type |
||
315 | */ |
||
316 | public function getType() |
||
320 | |||
321 | /** |
||
322 | * Return's the DB table prefix to use. |
||
323 | * |
||
324 | * @return string The DB table prefix |
||
325 | */ |
||
326 | public function getTablePrefix() |
||
330 | } |
||
331 |