1
|
|
|
<?php namespace FreedomCore\TrinityCore\Character\Models; |
2
|
|
|
|
3
|
|
|
use FreedomCore\TrinityCore\Character\Models\CharacterBaseModel; |
4
|
|
|
use FreedomCore\TrinityCore\Character\Models\Character as CharacterModel; |
5
|
|
|
|
6
|
|
|
/** |
7
|
|
|
* Class CharacterGarrisonFollower |
8
|
|
|
* |
9
|
|
|
* @package FreedomCore\TrinityCore\Character\Models |
10
|
|
|
* @property int $dbId |
11
|
|
|
* @property int $guid |
12
|
|
|
* @property int $followerId |
13
|
|
|
* @property int $quality |
14
|
|
|
* @property int $level |
15
|
|
|
* @property int $itemLevelWeapon |
16
|
|
|
* @property int $itemLevelArmor |
17
|
|
|
* @property int $xp |
18
|
|
|
* @property int $currentBuilding |
19
|
|
|
* @property int $currentMission |
20
|
|
|
* @property int $status |
21
|
|
|
* @property-read \FreedomCore\TrinityCore\Character\Models\Character $character |
22
|
|
|
* @property-read \Illuminate\Database\Eloquent\Collection|\FreedomCore\TrinityCore\Character\Models\CharacterGarrisonFollowerAbility[] $followerAbilities |
23
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterBaseModel incrementID() |
24
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterGarrisonFollower whereCurrentBuilding($value) |
25
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterGarrisonFollower whereCurrentMission($value) |
26
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterGarrisonFollower whereDbId($value) |
27
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterGarrisonFollower whereFollowerId($value) |
28
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterGarrisonFollower whereGuid($value) |
29
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterGarrisonFollower whereItemLevelArmor($value) |
30
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterGarrisonFollower whereItemLevelWeapon($value) |
31
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterGarrisonFollower whereLevel($value) |
32
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterGarrisonFollower whereQuality($value) |
33
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterGarrisonFollower whereStatus($value) |
34
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\FreedomCore\TrinityCore\Character\Models\CharacterGarrisonFollower whereXp($value) |
35
|
|
|
* @mixin \Eloquent |
36
|
|
|
*/ |
37
|
|
|
class CharacterGarrisonFollower extends CharacterBaseModel |
38
|
|
|
{ |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @inheritdoc |
42
|
|
|
* @var string |
43
|
|
|
*/ |
44
|
|
|
protected $primaryKey = 'dbId'; |
45
|
|
|
/** |
46
|
|
|
* @inheritdoc |
47
|
|
|
* @var bool |
48
|
|
|
*/ |
49
|
|
|
public $incrementing = true; |
50
|
|
|
/** |
51
|
|
|
* @inheritdoc |
52
|
|
|
* @var bool |
53
|
|
|
*/ |
54
|
|
|
public $timestamps = false; |
55
|
|
|
/** |
56
|
|
|
* @inheritdoc |
57
|
|
|
* @var array |
58
|
|
|
*/ |
59
|
|
|
protected $casts = [ |
60
|
|
|
'dbId' => 'int', |
61
|
|
|
'guid' => 'int', |
62
|
|
|
'followerId' => 'int', |
63
|
|
|
'quality' => 'int', |
64
|
|
|
'level' => 'int', |
65
|
|
|
'itemLevelWeapon' => 'int', |
66
|
|
|
'itemLevelArmor' => 'int', |
67
|
|
|
'xp' => 'int', |
68
|
|
|
'currentBuilding' => 'int', |
69
|
|
|
'currentMission' => 'int', |
70
|
|
|
'status' => 'int' |
71
|
|
|
]; |
72
|
|
|
/** |
73
|
|
|
* @inheritdoc |
74
|
|
|
* @var array |
75
|
|
|
*/ |
76
|
|
|
protected $fillable = [ |
77
|
|
|
'guid', |
78
|
|
|
'followerId', |
79
|
|
|
'quality', |
80
|
|
|
'level', |
81
|
|
|
'itemLevelWeapon', |
82
|
|
|
'itemLevelArmor', |
83
|
|
|
'xp', |
84
|
|
|
'currentBuilding', |
85
|
|
|
'currentMission', |
86
|
|
|
'status' |
87
|
|
|
]; |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* Get character to whom this follower belongs |
91
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
92
|
|
|
*/ |
93
|
|
|
public function character() |
94
|
|
|
{ |
95
|
|
|
return $this->belongsTo(CharacterModel::class, 'guid'); |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* Get abilities of selected follower |
100
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany |
101
|
|
|
*/ |
102
|
|
|
public function followerAbilities() |
103
|
|
|
{ |
104
|
|
|
return $this->hasMany(CharacterGarrisonFollowerAbility::class, 'dbId'); |
105
|
|
|
} |
106
|
|
|
} |
107
|
|
|
|