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

IPv4Mac::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
 * app/Models/General/MAC.php
4
 *
5
 * Model for MAC Search
6
 *
7
 * This program is free software: you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation, either version 3 of the License, or
10
 * (at your option) any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 *
20
 * @package    LibreNMS
21
 * @link       http://librenms.org
22
 * @copyright  2016 Neil Lathwood
23
 * @author     Neil Lathwood <[email protected]>
24
 */
25
26
namespace App\Models\General;
27
28
use Illuminate\Database\Eloquent\Model;
29
use Illuminate\Database\Eloquent\Builder;
30
31
/**
32
 * App\Models\General\SearchIPv4
33
 *
34
 */
35
class IPv4Mac extends Model
36
{
37
38
    protected $hidden = ['ip'];
39
40
    /**
41
     * Indicates if the model should be timestamped.
42
     *
43
     * @var bool
44
     */
45
    public $timestamps = false;
46
    /**
47
     * The table associated with the model.
48
     *
49
     * @var string
50
     */
51
    protected $table = 'ipv4_mac';
52
    /**
53
     * The primary key column name.
54
     *
55
     * @var string|bool
56
     */
57
    protected $primaryKey = false;
58
    /**
59
     * No incrementing primary key
60
     *
61
     * @var bool
62
     */
63
    public $incrementing = false;
64
65
    // ---- Accessors/Mutators ----
66
67
68
    // ---- Define Reletionships ----
69
70
    /**
71
     * Returns the port this entry belongs to.
72
     */
73
    public function port()
74
    {
75
        return $this->belongsTo('App\Models\Port', 'port_id', 'port_id');
76
    }
77
78
    /**
79
     * Returns the device this entry belongs to.
80
     */
81
    public function device()
82
    {
83
        return $this->belongsTo('App\Models\Device', 'device_id', 'device_id');
84
    }
85
86
}
87