1 | <?php |
||
26 | class MyClass{ |
||
27 | use DatabaseTrait; |
||
28 | |||
29 | protected $DBDriverInterface; |
||
30 | protected $options; |
||
31 | |||
32 | public function __construct(stdClass $class_options){ |
||
33 | $this->options = $class_options; |
||
34 | |||
35 | $this->DBDriverInterface = $this->dbconnect($this->options->dbdriver, $this->options->dbconfig); |
||
36 | |||
37 | var_dump($this->DBDriverInterface->getClientInfo()); |
||
38 | var_dump($this->DBDriverInterface->getServerInfo()); |
||
39 | var_dump($this->DBDriverInterface->raw('SELECT 1 + 1')); |
||
40 | |||
41 | // Inherited from the trait, holds the resource object of the last DatabaseTrait::dbconnect() call. |
||
42 | var_dump($this->db); |
||
43 | } |
||
44 | |||
45 | public function __destruct(){ |
||
46 | $this->DBDriverInterface->disconnect(); |
||
47 | } |
||
48 | |||
49 | } |
||
50 | |||
69 |