Conditions | 3 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 4 | public function query(object $sentencia): PDOStatement |
|
19 | { |
||
20 | 4 | $query = $this->_conexion->prepare($sentencia->sql()); |
|
21 | |||
22 | 4 | $x=1; |
|
23 | 4 | foreach ($sentencia->datos() as $value) |
|
24 | { |
||
25 | 4 | $query->bindValue($x,$value); |
|
26 | 4 | $x++; |
|
27 | } |
||
28 | |||
29 | try |
||
30 | { |
||
31 | 4 | $query->execute(); |
|
32 | } |
||
33 | 1 | catch(PDOException $e) |
|
34 | { |
||
35 | 1 | throw new Exception("Error en la consulta"); |
|
36 | } |
||
37 | |||
38 | 3 | return $query; |
|
39 | } |
||
40 | } |