Browse Source

Fixing get_count in the grade_model class

Julio Montoya 13 years ago
parent
commit
2492e6805f
1 changed files with 5 additions and 0 deletions
  1. 5 0
      main/inc/lib/grade_model.lib.php

+ 5 - 0
main/inc/lib/grade_model.lib.php

@@ -23,6 +23,11 @@ class GradeModel extends Model {
     
     public function get_all($where_conditions = array()) {
         return Database::select('*',$this->table, array('where'=>$where_conditions,'order' =>'name ASC'));
+    }
+    
+    public function get_count() {        
+        $row = Database::select('count(*) as count', $this->table, array(),'first');
+        return $row['count'];
     }    
     
     /**