1 | <?php |
||
32 | class Pack extends Model |
||
33 | { |
||
34 | use SearchableTrait; |
||
35 | |||
36 | /** |
||
37 | * The table associated with the model. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $table = 'packs'; |
||
42 | |||
43 | /** |
||
44 | * Fields that are mass assignable. |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | protected $fillable = [ |
||
49 | 'option_id', 'name', 'version', 'description', 'selectable', 'visible', 'locked', |
||
50 | ]; |
||
51 | |||
52 | /** |
||
53 | * Cast values to correct type. |
||
54 | * |
||
55 | * @var array |
||
56 | */ |
||
57 | protected $casts = [ |
||
58 | 'option_id' => 'integer', |
||
59 | 'selectable' => 'boolean', |
||
60 | 'visible' => 'boolean', |
||
61 | 'locked' => 'boolean', |
||
62 | ]; |
||
63 | |||
64 | /** |
||
65 | * Parameters for search querying. |
||
66 | * |
||
67 | * @var array |
||
68 | */ |
||
69 | protected $searchable = [ |
||
70 | 'columns' => [ |
||
71 | 'packs.name' => 10, |
||
72 | 'packs.uuid' => 8, |
||
73 | 'service_options.name' => 6, |
||
74 | 'service_options.tag' => 5, |
||
75 | 'service_options.docker_image' => 5, |
||
76 | 'packs.version' => 2, |
||
77 | ], |
||
78 | 'joins' => [ |
||
79 | 'service_options' => ['packs.option_id', 'service_options.id'], |
||
80 | ], |
||
81 | ]; |
||
82 | |||
83 | /** |
||
84 | * Returns all of the archived files for a given pack. |
||
85 | * |
||
86 | * @param bool $collection |
||
87 | * @return \Illuminate\Support\Collection|object |
||
88 | */ |
||
89 | public function files($collection = false) |
||
105 | |||
106 | /** |
||
107 | * Gets option associated with a service pack. |
||
108 | * |
||
109 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
110 | */ |
||
111 | public function option() |
||
115 | |||
116 | /** |
||
117 | * Gets servers associated with a pack. |
||
118 | * |
||
119 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
120 | */ |
||
121 | public function servers() |
||
125 | } |
||
126 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.