123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- {{ "<?php" }}
-
- /**
- * AUTO GENERATED BY LUTICATE GENERATOR
- * ANY CHANGES WILL BE OVERWRITTEN
- */
-
- namespace App\Http\DataAccess\Models;
-
- use Luticate\Utils\LuModel;
- use App\Http\DBO\{{ dbo_name.camel_upper }};
-
- class {{ model_name.camel_upper }} extends LuModel
- {
- function __construct()
- {
- parent::__construct();
- $this->timestamps = false;
- }
-
- public function toDbo()
- {
- $dbo = new {{ dbo_name.camel_upper }}();
-
- {% for column in columns %}
- $dbo->set{{ column.name.camel_upper }}($this->{{ column.name.as_it }});
- {% endfor %}
-
- return $dbo;
- }
-
- /**
- * @param $dbo \App\Http\DBO\{{ dbo_name.camel_upper }}
- * @param $dam LuModel|null
- * @return {{ model_name.camel_upper }}
- */
- public function fromDbo($dbo, $dam = null)
- {
- if (is_null($dam))
- $dam = new {{ model_name.camel_upper }}();
-
- {% for column in columns %}
- $dam->{{ column.name.as_it }} = $dbo->get{{ column.name.camel_upper }}();
- {% endfor %}
-
- return $dam;
- }
- }
|