<?php defined('SYSPATH') or die('No direct access allowed.'); class Model_Article_Comment extends ORM { protected $_belongs_to = array('user' => array()); static public function getCount( $article_id ) { $comment = ORM::Factory('article_comment')->where('article_id','=',$article_id)->find_all(); return $comment->count(); } }