我是 zend 框架的新手,在这个简单的函数中,我想获得一个“帖子”,然后我想在相关表中找到所有评论
public function getPost($idPost)
{
$db= Zend_Registry::get('db');
$select=$db->select()
->from($this->_name, '*')
->where("idPost= ".$db->quote($idPost, 'INTEGER'));
$stmt=$select->query();
$rowset=$stmt->fetchAll();
$post=$rowset->current();
//ora devo aggiungerci i commenti che questo post ha ricevuto
$comm=$post->findDependentRowset('commenti');
$ris=array($post, $comm);
return $ris;
}
在我的索引控制器 ii 中只需调用此函数,但我收到此错误:
Call to a member function current() on a non-object in C:\xampp\htdocs\...
哪里错了?