|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace App\Models; |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\Database\Eloquent\Model; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* App\Models\Storage |
|
9
|
|
|
* |
|
10
|
|
|
* @property integer $storage_id |
|
11
|
|
|
* @property integer $device_id |
|
12
|
|
|
* @property-read \App\Models\Device $device |
|
13
|
|
|
* @mixin \Eloquent |
|
14
|
|
|
* @property string $storage_mib |
|
15
|
|
|
* @property integer $storage_index |
|
16
|
|
|
* @property string $storage_type |
|
17
|
|
|
* @property string $storage_descr |
|
18
|
|
|
* @property integer $storage_size |
|
19
|
|
|
* @property integer $storage_units |
|
20
|
|
|
* @property integer $storage_used |
|
21
|
|
|
* @property integer $storage_free |
|
22
|
|
|
* @property integer $storage_perc |
|
23
|
|
|
* @property integer $storage_perc_warn |
|
24
|
|
|
* @property boolean $storage_deleted |
|
25
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Storage whereStorageId($value) |
|
26
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Storage whereDeviceId($value) |
|
27
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Storage whereStorageMib($value) |
|
28
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Storage whereStorageIndex($value) |
|
29
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Storage whereStorageType($value) |
|
30
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Storage whereStorageDescr($value) |
|
31
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Storage whereStorageSize($value) |
|
32
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Storage whereStorageUnits($value) |
|
33
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Storage whereStorageUsed($value) |
|
34
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Storage whereStorageFree($value) |
|
35
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Storage whereStoragePerc($value) |
|
36
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Storage whereStoragePercWarn($value) |
|
37
|
|
|
* @method static \Illuminate\Database\Query\Builder|\App\Models\Storage whereStorageDeleted($value) |
|
38
|
|
|
*/ |
|
39
|
|
|
class Storage extends Model |
|
40
|
|
|
{ |
|
41
|
|
|
/** |
|
42
|
|
|
* Indicates if the model should be timestamped. |
|
43
|
|
|
* |
|
44
|
|
|
* @var bool |
|
45
|
|
|
*/ |
|
46
|
|
|
public $timestamps = false; |
|
47
|
|
|
/** |
|
48
|
|
|
* The table associated with the model. |
|
49
|
|
|
* |
|
50
|
|
|
* @var string |
|
51
|
|
|
*/ |
|
52
|
|
|
protected $table = 'storage'; |
|
53
|
|
|
/** |
|
54
|
|
|
* The primary key column name. |
|
55
|
|
|
* |
|
56
|
|
|
* @var string |
|
57
|
|
|
*/ |
|
58
|
|
|
protected $primaryKey = 'storage_id'; |
|
59
|
|
|
|
|
60
|
|
|
// ---- Helper Functions ---- |
|
61
|
|
|
|
|
62
|
|
|
// ---- Accessors/Mutators ---- |
|
63
|
|
|
|
|
64
|
|
|
// ---- Query scopes ---- |
|
65
|
|
|
|
|
66
|
|
|
|
|
67
|
|
|
// ---- Define Relationships ---- |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* Get the device this port belongs to. |
|
71
|
|
|
* |
|
72
|
|
|
*/ |
|
73
|
|
|
public function device() |
|
74
|
|
|
{ |
|
75
|
|
|
return $this->belongsTo('App\Models\Device', 'device_id', 'device_id'); |
|
76
|
|
|
} |
|
77
|
|
|
} |
|
78
|
|
|
|