IPv6   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 48
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/IPv6.php
4
 *
5
 * Model for IPv6 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\IPv6
32
 *
33
 * @property integer $ipv6_address_id
34
 * @property string $ipv6_address
35
 * @property string $ipv6_compressed
36
 * @property integer $ipv6_prefixlen
37
 * @property string $ipv6_origin
38
 * @property string $ipv6_network_id
39
 * @property integer $port_id
40
 * @property string $context_name
41
 * @property-read \App\Models\Port $port
42
 * @property-read \App\Models\Device $device
43
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv6 whereIpv6AddressId($value)
44
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv6 whereIpv6Address($value)
45
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv6 whereIpv6Compressed($value)
46
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv6 whereIpv6Prefixlen($value)
47
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv6 whereIpv6Origin($value)
48
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv6 whereIpv6NetworkId($value)
49
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv6 wherePortId($value)
50
 * @method static \Illuminate\Database\Query\Builder|\App\Models\General\IPv6 whereContextName($value)
51
 * @mixin \Eloquent
52
 */
53
class IPv6 extends Model
54
{
55
56
    protected $hidden = ['ip'];
57
58
    /**
59
     * Indicates if the model should be timestamped.
60
     *
61
     * @var bool
62
     */
63
    public $timestamps = false;
64
    /**
65
     * The table associated with the model.
66
     *
67
     * @var string
68
     */
69
    protected $table = 'ipv6_addresses';
70
    /**
71
     * The primary key column name.
72
     *
73
     * @var string
74
     */
75
    protected $primaryKey = 'ipv6_address_id';
76
77
78
    // ---- Accessors/Mutators ----
79
80
81
    // ---- Define Relationships ----
82
83
    /**
84
     * Returns the port this entry belongs to.
85
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
86
     */
87
    public function port()
88
    {
89
        return $this->belongsTo('App\Models\Port', 'port_id', 'port_id');
90
    }
91
92
    /**
93
     * Returns the device this entry belongs to.
94
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
95
     */
96
    public function device()
97
    {
98
        return $this->belongsTo('App\Models\Device', 'device_id', 'device_id');
99
    }
100
}
101