Current File : /home/users/barii/public_html/finansenl.com.pl/wodki/application/classes/Model/post/comment.php
<?php defined('SYSPATH') or die('No direct access allowed.');

class Model_Post_Comment extends ORM {

   protected $_belongs_to = array('user' => array(), 'post' => array());
   


   static public function getCountUser( $post_id, $user_id ) {
   
		$comment = ORM::Factory('post_comment')->where('user_id','=', $user_id)->where('post_id','=',$post_id)->find_all();
		return $comment->count();
   
   }
   
    static public function getCount( $post_id ) {
   
		$comment = ORM::Factory('post_comment')->where('post_id','=',$post_id)->find_all();
		return $comment->count();
   
   }
   
    static public function getUsername( $user_id ) {
   
		$user = ORM::Factory('user', $user_id);
		return $user->username;
   
   }
}