Item.numNotes()

This commit is contained in:
Dan Stillman 2006-06-16 15:18:01 +00:00
parent 3cdcf3093a
commit 08a570a38a

View file

@ -713,6 +713,14 @@ Scholar.Item.prototype.removeNote = function(noteID){
return Scholar.DB.query(sql);
}
/**
* Returns number of notes in item
**/
Scholar.Item.prototype.numNotes = function(){
var sql = "SELECT COUNT(*) FROM itemNotes WHERE itemID=" + this.getID();
return parseInt(Scholar.DB.valueQuery(sql));
}
/**
* Get the text of an item note
**/