/** * Returns the number of the comments attached to the object. * * @param BaseObject $object * @param Array $options * @param Criteria $criteria * * @return integer */ public function getNbComments(BaseObject $object, $options = array(), Criteria $criteria = null) { $c = $this->getCommentsCriteria($object, $options, $criteria); return sfCommentPeer::doCount($c); }
/** * Returns the number of public comments attached to the object. * * @param BaseObject $object * @param Criteria $criteria * * @return integer */ public function getNbPublicComments(BaseObject $object, Criteria $criteria = null) { $c = $this->getCommentsCriteria($object, array(), $criteria); $c->add(sfCommentPeer::IS_PUBLIC, 1); return sfCommentPeer::doCount($c); }