You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CommandTypesModel.php 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * AUTO GENERATED BY LUTICATE GENERATOR
  4. * ANY CHANGES WILL BE OVERWRITTEN
  5. * DO NOT DIRECTLY USE THIS FILE
  6. * USE CommandTypes.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\CommandTypesDbo;
  12. class CommandTypesModel extends LuModel
  13. {
  14. function __construct()
  15. {
  16. parent::__construct();
  17. $this->timestamps = false;
  18. }
  19. public function toDbo()
  20. {
  21. $dbo = new CommandTypesDbo();
  22. $dbo->setId($this->id);
  23. $dbo->setName($this->name);
  24. $dbo->setClass($this->class);
  25. $dbo->setDefaultData($this->default_data);
  26. return $dbo;
  27. }
  28. /**
  29. * @param $dbo CommandTypesDbo
  30. * @param $model LuModel|null
  31. * @return CommandTypes
  32. */
  33. public function fromDbo($dbo, $model = null)
  34. {
  35. if (is_null($model))
  36. $model = new CommandTypes();
  37. $model->id = $dbo->getId();
  38. $model->name = $dbo->getName();
  39. $model->class = $dbo->getClass();
  40. $model->default_data = $dbo->getDefaultData();
  41. return $model;
  42. }
  43. }