📄 comment.php
字号:
<?phpclass Comment extends Zend_Db_Table { protected $_name = "commentaires"; public function getAll($clause = null){ ($clause)? $where = $clause : $where =''; $arrays = $this -> fetchAll($where,'date DESC'); $retour = array(); $user = new User(); foreach ($arrays as $indice => $tab){ $iuser = $user -> fetchRow('user_id = '.$tab -> user_id); $retour[$tab -> comment_id]['nom'] = ($iuser -> nom .' '.$iuser -> prenom); $retour[$tab -> comment_id]['titre'] = $tab -> titre; $retour[$tab -> comment_id]['contenu'] = $tab -> contenu; $retour[$tab -> comment_id]['date'] = new Zend_Date($tab -> date,null,'fr'); } return $retour; } public function count($clause = null){ ($clause)? $where = $clause : $where =''; return $this -> fetchAll($where,'date DESC') -> count(); }}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -