Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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 Hosts.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\HostsDbo;
  12. class HostsModel extends LuModel
  13. {
  14. function __construct()
  15. {
  16. parent::__construct();
  17. $this->timestamps = false;
  18. }
  19. public function toDbo()
  20. {
  21. $dbo = new HostsDbo();
  22. $dbo->setId($this->id);
  23. $dbo->setName($this->name);
  24. $dbo->setUrl($this->url);
  25. $dbo->setToken($this->token);
  26. return $dbo;
  27. }
  28. /**
  29. * @param $dbo HostsDbo
  30. * @param $model LuModel|null
  31. * @return Hosts
  32. */
  33. public function fromDbo($dbo, $model = null)
  34. {
  35. if (is_null($model))
  36. $model = new Hosts();
  37. $model->id = $dbo->getId();
  38. $model->name = $dbo->getName();
  39. $model->url = $dbo->getUrl();
  40. $model->token = $dbo->getToken();
  41. return $model;
  42. }
  43. }