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