Total Complexity | 9 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | class Entre |
||
7 | { |
||
8 | private $_entre; |
||
9 | private $_datos; |
||
10 | |||
11 | public function __construct(array $Entre) |
||
12 | { |
||
13 | $this->_entre = $this->setEntre($Entre); |
||
14 | } |
||
15 | |||
16 | public function donde(): string |
||
19 | } |
||
20 | |||
21 | public function datos(): array |
||
22 | { |
||
23 | return $this->_datos; |
||
24 | } |
||
25 | |||
26 | private function setEntre(array $columnas): string |
||
27 | { |
||
28 | if(count($columnas) !== 3) |
||
29 | { |
||
30 | throw new Exception("Faltan elementos en la sentencia BETWEEN"); |
||
31 | } |
||
32 | |||
33 | foreach($columnas as $columna) |
||
34 | { |
||
35 | $this->alfaNumerico($columna); |
||
36 | } |
||
37 | |||
38 | $this->_datos = $this->setDatos($columnas); |
||
39 | |||
40 | return ' WHERE '.$columnas[0].' BETWEEN ? AND ?'; |
||
41 | } |
||
42 | |||
43 | private function alfaNumerico($string) |
||
48 | } |
||
49 | } |
||
50 | |||
51 | private function setDatos(array $columnas): array |
||
54 | } |
||
55 | } |