1
|
|
|
<?php namespace FreedomCore\TrinityCore\Character\Models; |
2
|
|
|
|
3
|
|
|
use FreedomCore\TrinityCore\Character\Models\CharacterBaseModel; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class Guild |
7
|
|
|
* |
8
|
|
|
* @package FreedomCore\TrinityCore\Character\Models |
9
|
|
|
* @property int $guildid |
10
|
|
|
* @property string $name |
11
|
|
|
* @property int $leaderguid |
12
|
|
|
* @property int $EmblemStyle |
13
|
|
|
* @property int $EmblemColor |
14
|
|
|
* @property int $BorderStyle |
15
|
|
|
* @property int $BorderColor |
16
|
|
|
* @property int $BackgroundColor |
17
|
|
|
* @property string $info |
18
|
|
|
* @property string $motd |
19
|
|
|
* @property int $createdate |
20
|
|
|
* @property int $BankMoney |
21
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\FreedomCore\TrinityCore\Character\Models\GuildFinderApplicant[] $applicants |
22
|
|
|
* @property-read \FreedomCore\TrinityCore\Character\Models\Character $leader |
23
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\FreedomCore\TrinityCore\Character\Models\GuildMember[] $members |
24
|
|
|
* @property-read \FreedomCore\TrinityCore\Character\Models\GuildFinderGuildSetting $recruitmentSettings |
25
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterBaseModel incrementID() |
26
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\Guild whereBackgroundColor($value) |
27
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\Guild whereBankMoney($value) |
28
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\Guild whereBorderColor($value) |
29
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\Guild whereBorderStyle($value) |
30
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\Guild whereCreatedate($value) |
31
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\Guild whereEmblemColor($value) |
32
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\Guild whereEmblemStyle($value) |
33
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\Guild whereGuildid($value) |
34
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\Guild whereInfo($value) |
35
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\Guild whereLeaderguid($value) |
36
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\Guild whereMotd($value) |
37
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\Guild whereName($value) |
38
|
|
|
* @mixin \Eloquent |
39
|
|
|
*/ |
40
|
|
|
class Guild extends CharacterBaseModel |
41
|
|
|
{ |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @inheritdoc |
45
|
|
|
* @var string |
46
|
|
|
*/ |
47
|
|
|
protected $table = 'guild'; |
48
|
|
|
/** |
49
|
|
|
* @inheritdoc |
50
|
|
|
* @var string |
51
|
|
|
*/ |
52
|
|
|
protected $primaryKey = 'guildid'; |
53
|
|
|
/** |
54
|
|
|
* @inheritdoc |
55
|
|
|
* @var bool |
56
|
|
|
*/ |
57
|
|
|
public $incrementing = true; |
58
|
|
|
/** |
59
|
|
|
* @inheritdoc |
60
|
|
|
* @var bool |
61
|
|
|
*/ |
62
|
|
|
public $timestamps = false; |
63
|
|
|
/** |
64
|
|
|
* @inheritdoc |
65
|
|
|
* @var array |
66
|
|
|
*/ |
67
|
|
|
protected $casts = [ |
68
|
|
|
'guildid' => 'int', |
69
|
|
|
'leaderguid' => 'int', |
70
|
|
|
'EmblemStyle' => 'int', |
71
|
|
|
'EmblemColor' => 'int', |
72
|
|
|
'BorderStyle' => 'int', |
73
|
|
|
'BorderColor' => 'int', |
74
|
|
|
'BackgroundColor' => 'int', |
75
|
|
|
'createdate' => 'int', |
76
|
|
|
'BankMoney' => 'int' |
77
|
|
|
]; |
78
|
|
|
/** |
79
|
|
|
* @inheritdoc |
80
|
|
|
* @var array |
81
|
|
|
*/ |
82
|
|
|
protected $fillable = [ |
83
|
|
|
'name', |
84
|
|
|
'leaderguid', |
85
|
|
|
'EmblemStyle', |
86
|
|
|
'EmblemColor', |
87
|
|
|
'BorderStyle', |
88
|
|
|
'BorderColor', |
89
|
|
|
'BackgroundColor', |
90
|
|
|
'info', |
91
|
|
|
'motd', |
92
|
|
|
'createdate', |
93
|
|
|
'BankMoney' |
94
|
|
|
]; |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* Get character of the leader of the guild |
98
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
99
|
|
|
*/ |
100
|
|
|
public function leader() |
101
|
|
|
{ |
102
|
|
|
return $this->belongsTo(Character::class, 'leaderguid', 'guid'); |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* Get members of the guild |
107
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany |
108
|
|
|
*/ |
109
|
|
|
public function members() |
110
|
|
|
{ |
111
|
|
|
return $this->hasMany(GuildMember::class, 'guildid'); |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* Recruitment Settings For Specified Guild |
116
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasOne |
117
|
|
|
*/ |
118
|
|
|
public function recruitmentSettings() |
119
|
|
|
{ |
120
|
|
|
return $this->hasOne(GuildFinderGuildSetting::class, 'guildid'); |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* Get guild applications through the LFG system |
125
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany |
126
|
|
|
*/ |
127
|
|
|
public function applicants() |
128
|
|
|
{ |
129
|
|
|
return $this->hasMany(GuildFinderApplicant::class, 'guildId'); |
130
|
|
|
} |
131
|
|
|
} |
132
|
|
|
|