1 | <?php |
||
10 | class File extends Model implements FileContract |
||
11 | { |
||
12 | |||
13 | /** |
||
14 | * @inheritdoc |
||
15 | */ |
||
16 | protected $fillable = [ |
||
17 | 'file_id', |
||
18 | 'name', |
||
19 | 'extension', |
||
20 | 'path', |
||
21 | 'mime_type', |
||
22 | 'byte_size', |
||
23 | 'data', |
||
24 | 'disk', |
||
25 | 'saved_at', |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $hidden = [ |
||
32 | 'id', |
||
33 | ]; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $casts = [ |
||
39 | 'data' => 'array', |
||
40 | ]; |
||
41 | |||
42 | /** |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $dates = [ |
||
46 | 'saved_at', |
||
47 | ]; |
||
48 | |||
49 | /** |
||
50 | * @var array |
||
51 | */ |
||
52 | protected $guarded = ['*']; |
||
53 | |||
54 | /** |
||
55 | * @var bool |
||
56 | */ |
||
57 | public $timestamps = false; |
||
58 | |||
59 | |||
60 | /** |
||
61 | * @return string |
||
62 | */ |
||
63 | public function getId() |
||
67 | |||
68 | |||
69 | /** |
||
70 | * @return string |
||
71 | */ |
||
72 | public function getName() |
||
76 | |||
77 | |||
78 | /** |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getExtension() |
||
85 | |||
86 | |||
87 | /** |
||
88 | * @return string |
||
89 | */ |
||
90 | public function getMimeType() |
||
94 | |||
95 | |||
96 | /** |
||
97 | * @return int |
||
98 | */ |
||
99 | public function getByteSize() |
||
103 | |||
104 | |||
105 | /** |
||
106 | * @return array |
||
107 | */ |
||
108 | public function getData() |
||
112 | |||
113 | |||
114 | /** |
||
115 | * @return string |
||
116 | */ |
||
117 | public function getDisk() |
||
121 | |||
122 | |||
123 | /** |
||
124 | * @return Carbon |
||
125 | */ |
||
126 | public function getSavedAt() |
||
130 | |||
131 | |||
132 | /** |
||
133 | * @return string |
||
134 | */ |
||
135 | public function getSavedAtAsTimestamp() |
||
139 | |||
140 | |||
141 | /** |
||
142 | * @return string |
||
143 | */ |
||
144 | public function getFilename() |
||
148 | |||
149 | |||
150 | /** |
||
151 | * @inheritdoc |
||
152 | */ |
||
153 | public function getFilePath() |
||
157 | |||
158 | |||
159 | /** |
||
160 | * @inheritdoc |
||
161 | */ |
||
162 | public function getUrl(array $options = []) |
||
166 | |||
167 | |||
168 | /** |
||
169 | * @return string |
||
170 | */ |
||
171 | private function getPath() |
||
175 | |||
176 | |||
177 | /** |
||
178 | * @inheritdoc |
||
179 | */ |
||
180 | public function toArray() |
||
184 | |||
185 | |||
186 | /** |
||
187 | * @param string $id |
||
188 | * |
||
189 | * @return File |
||
190 | */ |
||
191 | public static function findByFileId($id) |
||
195 | } |
||
196 |
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.