
Untitled
By: a guest on
Oct 5th, 2012 | syntax:
JavaScript | size: 0.55 KB | hits: 64 | expires: Never
/**
* Loads a table either from our cached list, or inserts it into
* the database and adds it to our cached list
* @param options the table options
* @param callback callback(table or null)
*/
function loadTable(options, callback) {
var key = options.key + "." + options.tablename;
var priv = false;
if(options.tableid) {
key = options.key + "." + options.tableid;
priv = true;
}
if(tablelist[key]) {
callback(tablelist[key]);
return;
}
// insert or get existing
...