@@ -7,8 +7,8 @@ |
||
7 | 7 | |
8 | 8 | class ResultadoEnArrays implements ResultadoBaseDeDatosInterface |
9 | 9 | { |
10 | - public function resultado(PDOStatement $PDOStatement): array |
|
11 | - { |
|
12 | - return $PDOStatement->fetchAll(PDO::FETCH_ASSOC); |
|
13 | - } |
|
10 | + public function resultado(PDOStatement $PDOStatement): array |
|
11 | + { |
|
12 | + return $PDOStatement->fetchAll(PDO::FETCH_ASSOC); |
|
13 | + } |
|
14 | 14 | } |
15 | 15 | \ No newline at end of file |
@@ -7,8 +7,8 @@ |
||
7 | 7 | |
8 | 8 | class ResultadoEnJson implements ResultadoBaseDeDatosInterface |
9 | 9 | { |
10 | - public function resultado(PDOStatement $PDOStatement): string |
|
11 | - { |
|
12 | - return json_encode($PDOStatement->fetchAll(PDO::FETCH_ASSOC)); |
|
13 | - } |
|
10 | + public function resultado(PDOStatement $PDOStatement): string |
|
11 | + { |
|
12 | + return json_encode($PDOStatement->fetchAll(PDO::FETCH_ASSOC)); |
|
13 | + } |
|
14 | 14 | } |
15 | 15 | \ No newline at end of file |
@@ -3,20 +3,20 @@ |
||
3 | 3 | |
4 | 4 | class ContraseñaBaseDeDatos |
5 | 5 | { |
6 | - private $_contraseñaBaseDeDatos; |
|
6 | + private $_contraseñaBaseDeDatos; |
|
7 | 7 | |
8 | - public function __construct(string $nombreContraseñaBaseDeDatos) |
|
9 | - { |
|
10 | - $this->_contraseñaBaseDeDatos = $this->setContraseñaBaseDeDatos($nombreContraseñaBaseDeDatos); |
|
11 | - } |
|
8 | + public function __construct(string $nombreContraseñaBaseDeDatos) |
|
9 | + { |
|
10 | + $this->_contraseñaBaseDeDatos = $this->setContraseñaBaseDeDatos($nombreContraseñaBaseDeDatos); |
|
11 | + } |
|
12 | 12 | |
13 | - public function contraseñaBaseDeDatos(): string |
|
14 | - { |
|
15 | - return $this->_contraseñaBaseDeDatos; |
|
16 | - } |
|
13 | + public function contraseñaBaseDeDatos(): string |
|
14 | + { |
|
15 | + return $this->_contraseñaBaseDeDatos; |
|
16 | + } |
|
17 | 17 | |
18 | - private function setContraseñaBaseDeDatos(string $nombreContraseñaBaseDeDatos): string |
|
19 | - { |
|
20 | - return $nombreContraseñaBaseDeDatos; |
|
21 | - } |
|
18 | + private function setContraseñaBaseDeDatos(string $nombreContraseñaBaseDeDatos): string |
|
19 | + { |
|
20 | + return $nombreContraseñaBaseDeDatos; |
|
21 | + } |
|
22 | 22 | } |
23 | 23 | \ No newline at end of file |
@@ -7,22 +7,22 @@ |
||
7 | 7 | use src\FactoryClassInterface; |
8 | 8 | |
9 | 9 | use src\pdodatabase\conexion\{ |
10 | - ConexionBaseDeDatos, |
|
11 | - HostBaseDeDatos, |
|
12 | - BaseDeDatos, |
|
13 | - UsuarioBaseDeDatos, |
|
14 | - ContraseñaBaseDeDatos |
|
10 | + ConexionBaseDeDatos, |
|
11 | + HostBaseDeDatos, |
|
12 | + BaseDeDatos, |
|
13 | + UsuarioBaseDeDatos, |
|
14 | + ContraseñaBaseDeDatos |
|
15 | 15 | }; |
16 | 16 | |
17 | 17 | class CrearConexionBaseDeDatos implements FactoryClassInterface |
18 | 18 | { |
19 | - public function crear(array $array): ConexionBaseDeDatos |
|
20 | - { |
|
21 | - return new ConexionBaseDeDatos( |
|
22 | - new HostBaseDeDatos('127.0.0.1'), |
|
23 | - new BaseDeDatos('test'), |
|
24 | - new UsuarioBaseDeDatos('root'), |
|
25 | - new ContraseñaBaseDeDatos('') |
|
26 | - ); |
|
27 | - } |
|
19 | + public function crear(array $array): ConexionBaseDeDatos |
|
20 | + { |
|
21 | + return new ConexionBaseDeDatos( |
|
22 | + new HostBaseDeDatos('127.0.0.1'), |
|
23 | + new BaseDeDatos('test'), |
|
24 | + new UsuarioBaseDeDatos('root'), |
|
25 | + new ContraseñaBaseDeDatos('') |
|
26 | + ); |
|
27 | + } |
|
28 | 28 | } |
29 | 29 | \ No newline at end of file |
@@ -15,28 +15,28 @@ |
||
15 | 15 | |
16 | 16 | class SelectWhere implements FactoryClassInterface |
17 | 17 | { |
18 | - public function crear(array $array): object |
|
19 | - { |
|
20 | - $conexion = new CrearConexionBaseDeDatos; |
|
21 | - $conexion = $conexion->crear([]); |
|
18 | + public function crear(array $array): object |
|
19 | + { |
|
20 | + $conexion = new CrearConexionBaseDeDatos; |
|
21 | + $conexion = $conexion->crear([]); |
|
22 | 22 | |
23 | - return new ConsultaSelectWhere( |
|
24 | - new EjecutarConsultaConDatos( |
|
25 | - $conexion |
|
26 | - ), |
|
27 | - new SentenciaSelectWhere( |
|
28 | - new CamposYTabla( |
|
29 | - new Campos($array['campos']), |
|
30 | - new Tabla($array['tabla']) |
|
31 | - ), |
|
32 | - new Como( |
|
33 | - new Where( |
|
34 | - new ValidadorDeParametrosWhere( |
|
35 | - $array['where'] |
|
36 | - ) |
|
37 | - ) |
|
38 | - ) |
|
39 | - ) |
|
40 | - ); |
|
41 | - } |
|
23 | + return new ConsultaSelectWhere( |
|
24 | + new EjecutarConsultaConDatos( |
|
25 | + $conexion |
|
26 | + ), |
|
27 | + new SentenciaSelectWhere( |
|
28 | + new CamposYTabla( |
|
29 | + new Campos($array['campos']), |
|
30 | + new Tabla($array['tabla']) |
|
31 | + ), |
|
32 | + new Como( |
|
33 | + new Where( |
|
34 | + new ValidadorDeParametrosWhere( |
|
35 | + $array['where'] |
|
36 | + ) |
|
37 | + ) |
|
38 | + ) |
|
39 | + ) |
|
40 | + ); |
|
41 | + } |
|
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -15,28 +15,28 @@ |
||
15 | 15 | |
16 | 16 | class SelectWhereOr implements FactoryClassInterface |
17 | 17 | { |
18 | - public function crear(array $array): object |
|
19 | - { |
|
20 | - $conexion = new CrearConexionBaseDeDatos; |
|
21 | - $conexion = $conexion->crear([]); |
|
18 | + public function crear(array $array): object |
|
19 | + { |
|
20 | + $conexion = new CrearConexionBaseDeDatos; |
|
21 | + $conexion = $conexion->crear([]); |
|
22 | 22 | |
23 | - return new ConsultaSelectWhere( |
|
24 | - new EjecutarConsultaConDatos( |
|
25 | - $conexion |
|
26 | - ), |
|
27 | - new SentenciaSelectWhere( |
|
28 | - new CamposYTabla( |
|
29 | - new Campos($array['campos']), |
|
30 | - new Tabla($array['tabla']) |
|
31 | - ), |
|
32 | - new Como( |
|
33 | - new WhereOr( |
|
34 | - new ValidadorDeParametrosWhereAndOthers( |
|
35 | - $array['where'] |
|
36 | - ) |
|
37 | - ) |
|
38 | - ) |
|
39 | - ) |
|
40 | - ); |
|
41 | - } |
|
23 | + return new ConsultaSelectWhere( |
|
24 | + new EjecutarConsultaConDatos( |
|
25 | + $conexion |
|
26 | + ), |
|
27 | + new SentenciaSelectWhere( |
|
28 | + new CamposYTabla( |
|
29 | + new Campos($array['campos']), |
|
30 | + new Tabla($array['tabla']) |
|
31 | + ), |
|
32 | + new Como( |
|
33 | + new WhereOr( |
|
34 | + new ValidadorDeParametrosWhereAndOthers( |
|
35 | + $array['where'] |
|
36 | + ) |
|
37 | + ) |
|
38 | + ) |
|
39 | + ) |
|
40 | + ); |
|
41 | + } |
|
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -15,28 +15,28 @@ |
||
15 | 15 | |
16 | 16 | class SelectWhereBetween implements FactoryClassInterface |
17 | 17 | { |
18 | - public function crear(array $array): object |
|
19 | - { |
|
20 | - $conexion = new CrearConexionBaseDeDatos; |
|
21 | - $conexion = $conexion->crear([]); |
|
18 | + public function crear(array $array): object |
|
19 | + { |
|
20 | + $conexion = new CrearConexionBaseDeDatos; |
|
21 | + $conexion = $conexion->crear([]); |
|
22 | 22 | |
23 | - return new ConsultaSelectWhere( |
|
24 | - new EjecutarConsultaConDatos( |
|
25 | - $conexion |
|
26 | - ), |
|
27 | - new SentenciaSelectWhere( |
|
28 | - new CamposYTabla( |
|
29 | - new Campos($array['campos']), |
|
30 | - new Tabla($array['tabla']) |
|
31 | - ), |
|
32 | - new Como( |
|
33 | - new WhereBetween( |
|
34 | - new ValidadorDeParametrosWhereBetween( |
|
35 | - $array['where'] |
|
36 | - ) |
|
37 | - ) |
|
38 | - ) |
|
39 | - ) |
|
40 | - ); |
|
41 | - } |
|
23 | + return new ConsultaSelectWhere( |
|
24 | + new EjecutarConsultaConDatos( |
|
25 | + $conexion |
|
26 | + ), |
|
27 | + new SentenciaSelectWhere( |
|
28 | + new CamposYTabla( |
|
29 | + new Campos($array['campos']), |
|
30 | + new Tabla($array['tabla']) |
|
31 | + ), |
|
32 | + new Como( |
|
33 | + new WhereBetween( |
|
34 | + new ValidadorDeParametrosWhereBetween( |
|
35 | + $array['where'] |
|
36 | + ) |
|
37 | + ) |
|
38 | + ) |
|
39 | + ) |
|
40 | + ); |
|
41 | + } |
|
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -15,28 +15,28 @@ |
||
15 | 15 | |
16 | 16 | class SelectWhereNotBetween implements FactoryClassInterface |
17 | 17 | { |
18 | - public function crear(array $array): object |
|
19 | - { |
|
20 | - $conexion = new CrearConexionBaseDeDatos; |
|
21 | - $conexion = $conexion->crear([]); |
|
18 | + public function crear(array $array): object |
|
19 | + { |
|
20 | + $conexion = new CrearConexionBaseDeDatos; |
|
21 | + $conexion = $conexion->crear([]); |
|
22 | 22 | |
23 | - return new ConsultaSelectWhere( |
|
24 | - new EjecutarConsultaConDatos( |
|
25 | - $conexion |
|
26 | - ), |
|
27 | - new SentenciaSelectWhere( |
|
28 | - new CamposYTabla( |
|
29 | - new Campos($array['campos']), |
|
30 | - new Tabla($array['tabla']) |
|
31 | - ), |
|
32 | - new Como( |
|
33 | - new WhereNotBetween( |
|
34 | - new ValidadorDeParametrosWhereBetween( |
|
35 | - $array['where'] |
|
36 | - ) |
|
37 | - ) |
|
38 | - ) |
|
39 | - ) |
|
40 | - ); |
|
41 | - } |
|
23 | + return new ConsultaSelectWhere( |
|
24 | + new EjecutarConsultaConDatos( |
|
25 | + $conexion |
|
26 | + ), |
|
27 | + new SentenciaSelectWhere( |
|
28 | + new CamposYTabla( |
|
29 | + new Campos($array['campos']), |
|
30 | + new Tabla($array['tabla']) |
|
31 | + ), |
|
32 | + new Como( |
|
33 | + new WhereNotBetween( |
|
34 | + new ValidadorDeParametrosWhereBetween( |
|
35 | + $array['where'] |
|
36 | + ) |
|
37 | + ) |
|
38 | + ) |
|
39 | + ) |
|
40 | + ); |
|
41 | + } |
|
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -12,21 +12,21 @@ |
||
12 | 12 | |
13 | 13 | class Select implements FactoryClassInterface |
14 | 14 | { |
15 | - public function crear(array $array): object |
|
16 | - { |
|
17 | - $conexion = new CrearConexionBaseDeDatos; |
|
18 | - $conexion = $conexion->crear([]); |
|
15 | + public function crear(array $array): object |
|
16 | + { |
|
17 | + $conexion = new CrearConexionBaseDeDatos; |
|
18 | + $conexion = $conexion->crear([]); |
|
19 | 19 | |
20 | - return new ConsultaSelect( |
|
21 | - new EjecutarConsultaSinDatos( |
|
22 | - $conexion |
|
23 | - ), |
|
24 | - new SentenciaSelect( |
|
25 | - new CamposYTabla( |
|
26 | - new Campos($array['campos']), |
|
27 | - new Tabla($array['tabla']) |
|
28 | - ) |
|
29 | - ) |
|
30 | - ); |
|
31 | - } |
|
20 | + return new ConsultaSelect( |
|
21 | + new EjecutarConsultaSinDatos( |
|
22 | + $conexion |
|
23 | + ), |
|
24 | + new SentenciaSelect( |
|
25 | + new CamposYTabla( |
|
26 | + new Campos($array['campos']), |
|
27 | + new Tabla($array['tabla']) |
|
28 | + ) |
|
29 | + ) |
|
30 | + ); |
|
31 | + } |
|
32 | 32 | } |
33 | 33 | \ No newline at end of file |