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