Addresses #87, Add fromArray() and toArray() methods to Item objects
Item.getTags() (which toArray() uses) now returns actual tags rather than ids -- separate method getTagIDs to return ids
This commit is contained in:
parent
b7124bd8c1
commit
40b3ecc996
|
@ -971,6 +971,12 @@ Scholar.Item.prototype.addTag = function(tag){
|
|||
}
|
||||
|
||||
Scholar.Item.prototype.getTags = function(){
|
||||
var sql = "SELECT tag FROM tags WHERE tagID IN "
|
||||
+ "(SELECT tagID FROM itemTags WHERE itemID=" + this.getID() + ")";
|
||||
return Scholar.DB.columnQuery(sql);
|
||||
}
|
||||
|
||||
Scholar.Item.prototype.getTagIDs = function(){
|
||||
var sql = "SELECT tagID FROM itemTags WHERE itemID=" + this.getID();
|
||||
return Scholar.DB.columnQuery(sql);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user