2016-09-26 09:28:47 +00:00
|
|
|
|
2017-04-05 14:06:07 +00:00
|
|
|
var SqlObject = require ('./object');
|
|
|
|
var Value = require ('./value');
|
2016-09-26 09:28:47 +00:00
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
/**
|
|
|
|
* A holder for another object.
|
2016-12-20 09:32:17 +00:00
|
|
|
*/
|
2016-09-26 09:28:47 +00:00
|
|
|
module.exports = new Class
|
2015-01-23 13:09:30 +00:00
|
|
|
({
|
2017-04-05 14:06:07 +00:00
|
|
|
Extends: SqlObject
|
2015-01-23 13:09:30 +00:00
|
|
|
,Properties:
|
|
|
|
{
|
|
|
|
id:
|
|
|
|
{
|
|
|
|
type: String
|
|
|
|
,value: null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-05 14:06:07 +00:00
|
|
|
,render: function (params)
|
2015-01-23 13:09:30 +00:00
|
|
|
{
|
2017-04-10 15:17:56 +00:00
|
|
|
if (params)
|
2017-04-05 14:06:07 +00:00
|
|
|
{
|
2017-04-10 15:17:56 +00:00
|
|
|
var object = params[this.id];
|
|
|
|
|
2017-08-21 10:20:36 +00:00
|
|
|
if (object !== undefined)
|
2017-04-05 14:06:07 +00:00
|
|
|
{
|
2017-04-10 15:17:56 +00:00
|
|
|
if (!(object instanceof SqlObject))
|
|
|
|
{
|
|
|
|
var sqlValue = new Value ();
|
|
|
|
sqlValue.value = object;
|
|
|
|
return sqlValue.render ();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return object.render (params);
|
2017-04-05 14:06:07 +00:00
|
|
|
}
|
|
|
|
}
|
2015-01-23 13:09:30 +00:00
|
|
|
|
|
|
|
return '#'+ this.id;
|
|
|
|
}
|
|
|
|
});
|