您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

CommandsModel.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * AUTO GENERATED BY LUTICATE GENERATOR
  4. * ANY CHANGES WILL BE OVERWRITTEN
  5. * DO NOT DIRECTLY USE THIS FILE
  6. * USE Commands.php
  7. * TO MAKE YOUR CHANGES AND DATABASE ACCESS
  8. */
  9. namespace App\Http\DataAccess\Models;
  10. use Luticate\Utils\LuModel;
  11. use App\Http\DBO\CommandsDbo;
  12. class CommandsModel extends LuModel
  13. {
  14. function __construct()
  15. {
  16. parent::__construct();
  17. $this->timestamps = false;
  18. }
  19. public function toDbo()
  20. {
  21. $dbo = new CommandsDbo();
  22. $dbo->setId($this->id);
  23. $dbo->setName($this->name);
  24. $dbo->setDescription($this->description);
  25. $dbo->setHostId($this->host_id);
  26. $dbo->setCommandTypeId($this->command_type_id);
  27. $dbo->setData($this->data);
  28. return $dbo;
  29. }
  30. /**
  31. * @param $dbo CommandsDbo
  32. * @param $model LuModel|null
  33. * @return Commands
  34. */
  35. public function fromDbo($dbo, $model = null)
  36. {
  37. if (is_null($model))
  38. $model = new Commands();
  39. $model->id = $dbo->getId();
  40. $model->name = $dbo->getName();
  41. $model->description = $dbo->getDescription();
  42. $model->host_id = $dbo->getHostId();
  43. $model->command_type_id = $dbo->getCommandTypeId();
  44. $model->data = $dbo->getData();
  45. return $model;
  46. }
  47. }