123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
-
- /**
- * AUTO GENERATED BY LUTICATE GENERATOR
- * ANY CHANGES WILL BE OVERWRITTEN
- * DO NOT DIRECTLY USE THIS FILE
- * USE Commands.php
- * TO MAKE YOUR CHANGES AND DATABASE ACCESS
- */
-
- namespace App\Http\DataAccess\Models;
-
- use Luticate\Utils\LuModel;
- use App\Http\DBO\CommandsDbo;
-
- class CommandsModel extends LuModel
- {
- function __construct()
- {
- parent::__construct();
- $this->timestamps = false;
- }
-
- public function toDbo()
- {
- $dbo = new CommandsDbo();
-
- $dbo->setId($this->id);
- $dbo->setName($this->name);
- $dbo->setDescription($this->description);
- $dbo->setHostId($this->host_id);
- $dbo->setCommandTypeId($this->command_type_id);
- $dbo->setData($this->data);
-
- return $dbo;
- }
-
- /**
- * @param $dbo CommandsDbo
- * @param $model LuModel|null
- * @return Commands
- */
- public function fromDbo($dbo, $model = null)
- {
- if (is_null($model))
- $model = new Commands();
-
- $model->id = $dbo->getId();
- $model->name = $dbo->getName();
- $model->description = $dbo->getDescription();
- $model->host_id = $dbo->getHostId();
- $model->command_type_id = $dbo->getCommandTypeId();
- $model->data = $dbo->getData();
-
- return $model;
- }
- }
|