1 | <?php |
||
7 | trait Handler { |
||
8 | |||
9 | /** |
||
10 | * \addtogroup Bot Bot |
||
11 | * @{ |
||
12 | */ |
||
13 | |||
14 | /** Pdo connection to the database. */ |
||
15 | public $pdo; |
||
16 | |||
17 | /** |
||
18 | * \brief Open a database connection using PDO. |
||
19 | * \details Provides a simpler way to initialize a database connection |
||
20 | * and create a PDO instance. |
||
21 | * @param $params Parameters for initialize connection. |
||
22 | * @return True on success. |
||
23 | */ |
||
24 | public function connect($params) { |
||
38 | |||
39 | protected function mergeWithDefaults($params) { |
||
43 | |||
44 | /** \brief Returns a string that can passed to PDO in order to open connection. */ |
||
45 | protected function stringify($params) : string { |
||
65 | |||
66 | /** @} */ |
||
67 | |||
68 | } |
||
69 |