|
@@ -19,6 +19,27 @@ class {{ dbo_name.camel_upper }} extends LuDbo {
|
19
|
19
|
{% endfor %}
|
20
|
20
|
);
|
21
|
21
|
}
|
|
22
|
+
|
|
23
|
+ public static function jsonDeserialize($json)
|
|
24
|
+ {
|
|
25
|
+ $dbo = new {{ dbo_name.camel_upper }}();
|
|
26
|
+{% for column in columns %}
|
|
27
|
+ $dbo->set{{ column.name.camel_upper }}($json["{{ column.name.camel_upper }}"]);
|
|
28
|
+{% endfor %}
|
|
29
|
+ return $dbo;
|
|
30
|
+ }
|
|
31
|
+
|
|
32
|
+ public static function generateSample()
|
|
33
|
+ {
|
|
34
|
+ $dbo = new {{ dbo_name.camel_upper }}();
|
|
35
|
+{% for column in columns %}
|
|
36
|
+ $dbo->set{{ column.name.camel_upper }}({% if column.data_type.php.as_it == "double" %}42.42{%
|
|
37
|
+elseif column.data_type.php.as_it == "integer" %}42{%
|
|
38
|
+elseif column.data_type.php.as_it == "boolean" %}true{%
|
|
39
|
+else %}"sample string"{% endif %});
|
|
40
|
+{% endfor %}
|
|
41
|
+ return $dbo;
|
|
42
|
+ }
|
22
|
43
|
{% for column in columns %}
|
23
|
44
|
|
24
|
45
|
/**
|