Completed
Push — settings ( bea8d4...96499a )
by Tony
05:40
created

Sensor::device()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\Builder;
7
8
/**
9
 * App\Models\Sensor
10
 *
11
 */
12
class Sensor extends Model
13
{
14
    /**
15
     * Indicates if the model should be timestamped.
16
     *
17
     * @var bool
18
     */
19
    public $timestamps = false;
20
    /**
21
     * The table associated with the model.
22
     *
23
     * @var string
24
     */
25
    protected $table = 'sensors';
26
    /**
27
     * The primary key column name.
28
     *
29
     * @var string
30
     */
31
    protected $primaryKey = 'sensors_id';
32
33
    // ---- Define Reletionships ----
34
35
    /**
36
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
37
     */
38
    public function device()
39
    {
40
        return $this->belongsTo('App\Models\Device', 'device_id');
41
    }
42
43
}
44