34 lines
549 B
JavaScript
34 lines
549 B
JavaScript
|
|
var SqlObject = require('./object');
|
|
var Value = require('./value');
|
|
|
|
/**
|
|
* A holder for another object.
|
|
*/
|
|
module.exports = new Class({
|
|
Extends: SqlObject
|
|
,Properties: {
|
|
id: {
|
|
type: String
|
|
,value: null
|
|
}
|
|
}
|
|
|
|
,render(params) {
|
|
if (params) {
|
|
var object = params[this.id];
|
|
|
|
if (object !== undefined) {
|
|
if (!(object instanceof SqlObject)) {
|
|
var sqlValue = new Value();
|
|
sqlValue.value = object;
|
|
return sqlValue.render();
|
|
} else
|
|
return object.render(params);
|
|
}
|
|
}
|
|
|
|
return '#'+ this.id;
|
|
}
|
|
});
|