comment.php

来自「Bug tracker, and reporter.」· PHP 代码 · 共 30 行

PHP
30
字号
<?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 + =
减小字号Ctrl + -
显示快捷键?