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