1 | <?php namespace Mascame\Artificer\Model; |
||
10 | class Model |
||
11 | { |
||
12 | |||
13 | /** |
||
14 | * @var ModelSchema |
||
15 | */ |
||
16 | public $schema; |
||
17 | |||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | public $models; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | public $columns; |
||
27 | |||
28 | /** |
||
29 | * @var mixed |
||
30 | */ |
||
31 | public $model; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | public $class; |
||
37 | |||
38 | /** |
||
39 | * @var |
||
40 | */ |
||
41 | public $name; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | public $keyname; |
||
47 | |||
48 | /** |
||
49 | * @var |
||
50 | */ |
||
51 | public $table; |
||
52 | |||
53 | /** |
||
54 | * @var |
||
55 | */ |
||
56 | public $fillable; |
||
57 | |||
58 | /** |
||
59 | * @var array|mixed |
||
60 | */ |
||
61 | public $options = array(); |
||
62 | |||
63 | /** |
||
64 | * @var array|mixed |
||
65 | */ |
||
66 | public $relations = array(); |
||
67 | |||
68 | /** |
||
69 | * @var |
||
70 | */ |
||
71 | public static $current = null; |
||
72 | |||
73 | /** |
||
74 | * @param ModelSchema $schema |
||
75 | */ |
||
76 | public function __construct(ModelSchema $schema) |
||
84 | |||
85 | |||
86 | public function share() |
||
92 | |||
93 | /** |
||
94 | * @return array |
||
95 | */ |
||
96 | private function getCurrentModelsData() |
||
105 | |||
106 | /** |
||
107 | * @param $modelName |
||
108 | * @return bool |
||
109 | */ |
||
110 | public function isHidden($modelName) |
||
114 | |||
115 | /** |
||
116 | * @return bool |
||
117 | */ |
||
118 | public function hasGuarded() |
||
122 | |||
123 | /** |
||
124 | * @return bool |
||
125 | */ |
||
126 | public function hasFillable() |
||
130 | |||
131 | /** |
||
132 | * @return int|null|string |
||
133 | */ |
||
134 | private function getCurrentModelName() |
||
150 | |||
151 | public function prepareCurrentModel() |
||
166 | |||
167 | /** |
||
168 | * @return array |
||
169 | */ |
||
170 | private function getCurrentModelData() |
||
182 | |||
183 | /** |
||
184 | * @param $model |
||
185 | * @return bool |
||
186 | */ |
||
187 | protected function isCurrent($modelName) |
||
193 | |||
194 | /** |
||
195 | * @return null |
||
196 | */ |
||
197 | public static function getCurrent() |
||
201 | |||
202 | /** |
||
203 | * @return string |
||
204 | */ |
||
205 | public static function getCurrentClass() |
||
209 | |||
210 | /** |
||
211 | * @param null $model |
||
212 | * @return null |
||
213 | */ |
||
214 | public function getRouteName($model = null) |
||
220 | |||
221 | /** |
||
222 | * @param $modelName |
||
223 | */ |
||
224 | protected function setCurrent($modelName) |
||
229 | |||
230 | /** |
||
231 | * @param null $model |
||
232 | * @return mixed |
||
233 | */ |
||
234 | public function getOptions($model = null) |
||
238 | |||
239 | /** |
||
240 | * @param $key |
||
241 | * @param null $model |
||
242 | * @return mixed |
||
243 | */ |
||
244 | public function getOption($key, $default = null, $model = null) |
||
248 | |||
249 | /** |
||
250 | * @return array|mixed |
||
251 | */ |
||
252 | public function getRelations() |
||
256 | |||
257 | } |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.