|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace App\Models; |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\Database\Eloquent\Model; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* App\Models\Sensor |
|
9
|
|
|
* |
|
10
|
|
|
* @property integer $sensor_id |
|
11
|
|
|
* @property boolean $sensor_deleted |
|
12
|
|
|
* @property string $sensor_class |
|
13
|
|
|
* @property integer $device_id |
|
14
|
|
|
* @property string $poller_type |
|
15
|
|
|
* @property string $sensor_oid |
|
16
|
|
|
* @property string $sensor_index |
|
17
|
|
|
* @property string $sensor_type |
|
18
|
|
|
* @property string $sensor_descr |
|
19
|
|
|
* @property integer $sensor_divisor |
|
20
|
|
|
* @property integer $sensor_multiplier |
|
21
|
|
|
* @property float $sensor_current |
|
22
|
|
|
* @property float $sensor_limit |
|
23
|
|
|
* @property float $sensor_limit_warn |
|
24
|
|
|
* @property float $sensor_limit_low |
|
25
|
|
|
* @property float $sensor_limit_low_warn |
|
26
|
|
|
* @property boolean $sensor_alert |
|
27
|
|
|
* @property string $sensor_custom |
|
28
|
|
|
* @property string $entPhysicalIndex |
|
29
|
|
|
* @property string $entPhysicalIndex_measured |
|
30
|
|
|
* @property string $lastupdate |
|
31
|
|
|
* @property float $sensor_prev |
|
32
|
|
|
* @property-read \App\Models\Device $device |
|
33
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorId($value) |
|
34
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorDeleted($value) |
|
35
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorClass($value) |
|
36
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereDeviceId($value) |
|
37
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor wherePollerType($value) |
|
38
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorOid($value) |
|
39
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorIndex($value) |
|
40
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorType($value) |
|
41
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorDescr($value) |
|
42
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorDivisor($value) |
|
43
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorMultiplier($value) |
|
44
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorCurrent($value) |
|
45
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorLimit($value) |
|
46
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorLimitWarn($value) |
|
47
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorLimitLow($value) |
|
48
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorLimitLowWarn($value) |
|
49
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorAlert($value) |
|
50
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorCustom($value) |
|
51
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereEntPhysicalIndex($value) |
|
52
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereEntPhysicalIndexMeasured($value) |
|
53
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereLastupdate($value) |
|
54
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Sensor whereSensorPrev($value) |
|
55
|
|
|
* @mixin \Eloquent |
|
56
|
|
|
*/ |
|
57
|
|
|
class Sensor extends Model |
|
58
|
|
|
{ |
|
59
|
|
|
/** |
|
60
|
|
|
* Indicates if the model should be timestamped. |
|
61
|
|
|
* |
|
62
|
|
|
* @var bool |
|
63
|
|
|
*/ |
|
64
|
|
|
public $timestamps = false; |
|
65
|
|
|
/** |
|
66
|
|
|
* The table associated with the model. |
|
67
|
|
|
* |
|
68
|
|
|
* @var string |
|
69
|
|
|
*/ |
|
70
|
|
|
protected $table = 'sensors'; |
|
71
|
|
|
/** |
|
72
|
|
|
* The primary key column name. |
|
73
|
|
|
* |
|
74
|
|
|
* @var string |
|
75
|
|
|
*/ |
|
76
|
|
|
protected $primaryKey = 'sensors_id'; |
|
77
|
|
|
|
|
78
|
|
|
// ---- Define Relationships ---- |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
|
82
|
|
|
*/ |
|
83
|
|
|
public function device() |
|
84
|
|
|
{ |
|
85
|
|
|
return $this->belongsTo('App\Models\Device', 'device_id'); |
|
86
|
|
|
} |
|
87
|
|
|
} |
|
88
|
|
|
|