IPv4Mac   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 53
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A port() 0 4 1
A device() 0 4 1
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
30
/**
31
 * App\Models\General\IPv4Mac
32
 *
33
 * @property integer $port_id
34
 * @property string $mac_address
35
 * @property string $ipv4_address
36
 * @property string $context_name
37
 * @property-read \App\Models\Port $port
38
 * @property-read \App\Models\Device $device
39
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv4Mac wherePortId($value)
40
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv4Mac whereMacAddress($value)
41
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv4Mac whereIpv4Address($value)
42
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv4Mac whereContextName($value)
43
 * @mixin \Eloquent
44
 */
45
class IPv4Mac extends Model
46
{
47
48
    protected $hidden = ['ip'];
49
50
    /**
51
     * Indicates if the model should be timestamped.
52
     *
53
     * @var bool
54
     */
55
    public $timestamps = false;
56
    /**
57
     * The table associated with the model.
58
     *
59
     * @var string
60
     */
61
    protected $table = 'ipv4_mac';
62
    /**
63
     * The primary key column name.
64
     *
65
     * @var string|bool
66
     */
67
    protected $primaryKey = false;
68
    /**
69
     * No incrementing primary key
70
     *
71
     * @var bool
72
     */
73
    public $incrementing = false;
74
75
    // ---- Accessors/Mutators ----
76
77
78
    // ---- Define Relationships ----
79
80
    /**
81
     * Returns the port this entry belongs to.
82
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
83
     */
84
    public function port()
85
    {
86
        return $this->belongsTo('App\Models\Port', 'port_id', 'port_id');
87
    }
88
89
    /**
90
     * Returns the device this entry belongs to.
91
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
92
     */
93
    public function device()
94
    {
95
        return $this->belongsTo('App\Models\Device', 'device_id', 'device_id');
96
    }
97
}
98