0
1
Fork 0
hedera-web-mindshore/js/sql/holder.js

34 lines
559 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
2022-06-06 08:53:59 +00:00
var SqlObject = require('./object');
var Value = require('./value');
2016-09-26 09:28:47 +00:00
/**
* A holder for another object.
2022-05-26 06:08:31 +00:00
*/
2022-06-06 08:53:59 +00:00
module.exports = new Class({
2022-05-30 01:30:33 +00:00
Extends: SqlObject
2022-06-06 08:53:59 +00:00
,Properties: {
id: {
type: String
,value: null
}
}
2022-06-06 08:53:59 +00:00
,render: function(params) {
if (params) {
2022-05-30 01:30:33 +00:00
var object = params[this.id];
2022-06-06 08:53:59 +00:00
if (object !== undefined) {
if (!(object instanceof SqlObject)) {
var sqlValue = new Value();
2022-05-30 01:30:33 +00:00
sqlValue.value = object;
2022-06-06 08:53:59 +00:00
return sqlValue.render();
} else
return object.render(params);
2022-05-30 01:30:33 +00:00
}
}
return '#'+ this.id;
}
});