1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* To change this license header, choose License Headers in Project Properties. |
5
|
|
|
* To change this template file, choose Tools | Templates |
6
|
|
|
* and open the template in the editor. |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
class blogModelo extends Sistema\Nucleo\CFModelo |
10
|
|
|
{ |
11
|
|
|
|
12
|
|
|
public function __construct() { |
13
|
|
|
parent::__construct(); |
14
|
|
|
} |
15
|
|
|
|
16
|
|
View Code Duplication |
public function insertarDatos($id_blog, $nombre, $email, $comentario){ |
17
|
|
|
|
18
|
|
|
$post=$this->_bd->consulta('INSERT INTO comentarios (id_blog, nombre, email, comentario) VALUES (:id_blog, :nombre, :email, :comentario)'); |
|
|
|
|
19
|
|
|
$post=$this->_bd->enlace(':id_blog', $id_blog); |
|
|
|
|
20
|
|
|
$post=$this->_bd->enlace(':nombre',$nombre); |
|
|
|
|
21
|
|
|
$post=$this->_bd->enlace(':email', $email); |
|
|
|
|
22
|
|
|
$post=$this->_bd->enlace(':comentario', $comentario); |
|
|
|
|
23
|
|
|
$post=$this->_bd->ejecucion(); |
24
|
|
|
return $post=$this->_bd->resultset(); |
25
|
|
|
|
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public function llamarDatosCategoria(){ |
29
|
|
|
//echo DB_HOST; |
30
|
|
|
$cate=$this->_bd->consulta('select * from categoria '); |
|
|
|
|
31
|
|
|
return $cate=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
32
|
|
|
|
33
|
|
|
|
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
public function llamarDatosTags(){ |
37
|
|
|
//echo DB_HOST; |
38
|
|
|
$post=$this->_bd->consulta('select * from tags '); |
|
|
|
|
39
|
|
|
return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
40
|
|
|
|
41
|
|
|
|
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
|
45
|
|
|
public function llamarDatosBlog(){ |
46
|
|
|
//echo DB_HOST; |
47
|
|
|
$post=$this->_bd->consulta('select * from blog '); |
|
|
|
|
48
|
|
|
return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
49
|
|
|
|
50
|
|
|
|
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function llamarDatosBlogId($id){ |
54
|
|
|
//echo DB_HOST; |
55
|
|
|
$idvideo=$id; |
56
|
|
|
$datosQuery="select idvideo from blog where id = :idvideo"; |
57
|
|
|
$gsent=$this->_bd->consulta('SELECT idvideo FROM blog WHERE id = :idvideo'); |
|
|
|
|
58
|
|
|
$gsent=$this->_bd->enlace(':idvideo', $idvideo); |
|
|
|
|
59
|
|
|
//$gsent=$this->_bd->ejecucion(); |
60
|
|
|
$row = $gsent=$this->_bd->single(); |
61
|
|
|
return $row; |
62
|
|
|
|
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function llamarComentarios(){ |
66
|
|
|
//echo DB_HOST; |
67
|
|
|
$post=$this->_bd->consulta('select * from comentarios '); |
|
|
|
|
68
|
|
|
return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
69
|
|
|
|
70
|
|
|
|
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
public function contarComentarios($id){ |
|
|
|
|
74
|
|
|
//echo DB_HOST; |
75
|
|
|
$post=$this->_bd->consulta('SELECT COUNT(*) FROM comentarios'); |
|
|
|
|
76
|
|
|
return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
77
|
|
|
|
78
|
|
|
|
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
} |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.