1 | <?php |
||
16 | abstract class RepositoryAbstract |
||
17 | { |
||
18 | public static $BASE_PATH = 'posts'; |
||
19 | |||
20 | /** |
||
21 | * @return string |
||
22 | */ |
||
23 | 4 | public function __toString() |
|
29 | |||
30 | /** |
||
31 | * @param $ar |
||
32 | * |
||
33 | * @return string |
||
34 | */ |
||
35 | 4 | private function prepareCall($ar) |
|
45 | |||
46 | /** |
||
47 | * @param $method |
||
48 | * @param $params |
||
49 | * |
||
50 | * @return $this |
||
51 | */ |
||
52 | 2 | public function __call($method, $params) |
|
62 | |||
63 | /** |
||
64 | * @param $id |
||
65 | * |
||
66 | * @return $this |
||
67 | */ |
||
68 | 4 | public function whereId($id) |
|
74 | |||
75 | /** |
||
76 | * Set's. |
||
77 | * |
||
78 | * @param $key |
||
79 | * @param $value |
||
80 | */ |
||
81 | public function setNotFiltered($key, $value) |
||
87 | |||
88 | 4 | public function whereIds($ids) |
|
94 | |||
95 | /** |
||
96 | * Checks if there is any cache data for query. |
||
97 | * |
||
98 | * @param CachePool $cachePool |
||
99 | */ |
||
100 | 2 | public function getCacheKey() |
|
105 | } |
||
106 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: