Total Complexity | 8 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class StaticModel extends Model |
||
9 | { |
||
10 | public static $keyColumn = 'key'; |
||
11 | |||
12 | /** |
||
13 | * @return array |
||
14 | */ |
||
15 | public function getModelAttributes() { |
||
17 | } |
||
18 | |||
19 | /** |
||
20 | * @return static[] |
||
21 | */ |
||
22 | public function allModels() |
||
23 | { |
||
24 | $models = []; |
||
25 | $data = $this->getModelAttributes(); |
||
26 | if (!empty($data)) { |
||
27 | foreach ($data as $attributes) { |
||
28 | $models[] = new static($attributes); |
||
29 | } |
||
30 | } |
||
31 | return $models; |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @param $id |
||
36 | * @return static |
||
37 | */ |
||
38 | public static function getById($id) { |
||
44 | } |
||
45 | /** |
||
46 | * @param $key |
||
47 | * @return static |
||
48 | */ |
||
49 | public static function getByKey($key) { |
||
58 | } |