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.

ImagesModel.php 1.1KB

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