1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the Ocrend Framewok 3 package. |
||
5 | * |
||
6 | * (c) Ocrend Software <[email protected]> |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace Ocrend\Kernel\Models\Traits; |
||
13 | |||
14 | use Ocrend\Kernel\Database\Database; |
||
15 | |||
16 | /** |
||
17 | * Añade características a un modelo para que pueda conectarse a una base de datos. |
||
18 | * |
||
19 | * @author Brayan Narváez <[email protected]> |
||
20 | */ |
||
21 | |||
22 | trait DBModel { |
||
23 | |||
24 | /** |
||
25 | * Tiene la instancia de la base de datos actual |
||
26 | * |
||
27 | * @var null|Mysql|Sqlite; |
||
28 | */ |
||
29 | protected $db = null; |
||
30 | |||
31 | /** |
||
32 | * Constructor inicial del modelo. |
||
33 | * Arranca la base de datos |
||
34 | * |
||
35 | * @param $driver : Driver para establecer la conexión de este modelo |
||
36 | * |
||
37 | * @return void |
||
38 | */ |
||
39 | protected function startDBConexion($driver = null) { |
||
40 | global $config; |
||
41 | $this->db = Database::resolveDriver($driver ?? $config['database']['default_driver']); |
||
0 ignored issues
–
show
|
|||
42 | } |
||
43 | } |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..