Passed
Push — master ( d45363...8235a7 )
by Darko
06:53
created

ReleasesGroups   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 1
b 0
f 0
dl 0
loc 39
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A release() 0 3 1
A group() 0 3 1
1
<?php
2
3
/**
4
 * This program is free software: you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation, either version 3 of the License, or
7
 * (at your option) any later version.
8
 * This program is distributed in the hope that it will be useful,
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 * GNU General Public License for more details.
12
 * You should have received a copy of the GNU General Public License
13
 * along with this program (see LICENSE.txt in the base directory.  If
14
 * not, see:.
15
 *
16
 * @link      <http://www.gnu.org/licenses/>.
17
 *
18
 * @author    niel
19
 * @copyright 2016 nZEDb
20
 */
21
22
namespace App\Models;
23
24
use Illuminate\Database\Eloquent\Model;
25
use Illuminate\Database\Eloquent\Relations\BelongsTo;
26
27
/**
28
 * App\Models\ReleasesGroups.
29
 *
30
 * @property int $releases_id FK to releases.id
31
 * @property int $groups_id FK to groups.id
32
 * @property-read Release $release
33
 *
34
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ReleasesGroups whereGroupsId($value)
35
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ReleasesGroups whereReleasesId($value)
36
 *
37
 * @mixin \Eloquent
38
 *
39
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ReleasesGroups newModelQuery()
40
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ReleasesGroups newQuery()
41
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ReleasesGroups query()
42
 */
43
class ReleasesGroups extends Model
44
{
45
    /**
46
     * @var string
47
     */
48
49
    /**
50
     * @var bool
51
     */
52
    public $incrementing = false;
53
54
    /**
55
     * @var bool
56
     */
57
    public $timestamps = false;
58
59
    /**
60
     * @var bool
61
     */
62
    public $dateFormat = false;
63
64
    /**
65
     * @var array
66
     */
67
    protected $primaryKey = ['releases_id', 'groups_id'];
68
69
    /**
70
     * @var array
71
     */
72
    protected $guarded = [];
73
74
    public function release(): BelongsTo
75
    {
76
        return $this->belongsTo(Release::class, 'releases_id');
77
    }
78
79
    public function group(): BelongsTo
80
    {
81
        return $this->belongsTo(UsenetGroup::class, 'groups_id');
82
    }
83
}
84