GuildMember::character()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php namespace FreedomCore\TrinityCore\Character\Models;
2
3
use FreedomCore\TrinityCore\Character\Models\CharacterBaseModel;
4
5
/**
6
 * Class GuildMember
7
 *
8
 * @package FreedomCore\TrinityCore\Character\Models
9
 * @property int $guildid Guild Identificator
10
 * @property int $guid
11
 * @property int $rank
12
 * @property string $pnote
13
 * @property string $offnote
14
 * @property-read \FreedomCore\TrinityCore\Character\Models\Character $character
15
 * @property-read \FreedomCore\TrinityCore\Character\Models\Guild $guild
16
 * @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterBaseModel incrementID()
17
 * @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\GuildMember whereGuid($value)
18
 * @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\GuildMember whereGuildid($value)
19
 * @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\GuildMember whereOffnote($value)
20
 * @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\GuildMember wherePnote($value)
21
 * @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\GuildMember whereRank($value)
22
 * @mixin \Eloquent
23
 */
24
class GuildMember extends CharacterBaseModel
25
{
26
27
    /**
28
    * @inheritdoc
29
    * @var string
30
    */
31
    protected $table = 'guild_member';
32
    /**
33
    * @inheritdoc
34
    * @var string
35
    */
36
    protected $primaryKey = 'guid';
37
    /**
38
    * @inheritdoc
39
    * @var bool
40
    */
41
    public $incrementing = false;
42
    /**
43
    * @inheritdoc
44
    * @var bool
45
    */
46
    public $timestamps = false;
47
    /**
48
    * @inheritdoc
49
    * @var array
50
    */
51
    protected $casts = [
52
        'guildid' => 'int',
53
        'guid' => 'int',
54
        'rank' => 'int'
55
    ];
56
    /**
57
    * @inheritdoc
58
    * @var array
59
    */
60
    protected $fillable = [
61
        'guildid',
62
        'rank',
63
        'pnote',
64
        'offnote'
65
    ];
66
67
    /**
68
     * Get character information
69
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
70
     */
71
    public function character()
72
    {
73
        return $this->belongsTo(Character::class, 'guid');
74
    }
75
76
    /**
77
     * Get guild to which this member belongs to
78
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
79
     */
80
    public function guild()
81
    {
82
        return $this->belongsTo(Guild::class, 'guildid');
83
    }
84
}
85