1 | <?php |
||
15 | abstract class RepositoryAbstract |
||
16 | { |
||
17 | public static $BASE_PATH = 'posts'; |
||
18 | |||
19 | /** |
||
20 | * @return string |
||
21 | */ |
||
22 | public function __toString() |
||
28 | |||
29 | /** |
||
30 | * @param $ar |
||
31 | * |
||
32 | * @return string |
||
33 | */ |
||
34 | private function prepareCall($ar) |
||
44 | |||
45 | /** |
||
46 | * @param $method |
||
47 | * @param $params |
||
48 | * |
||
49 | * @return $this |
||
50 | */ |
||
51 | public function __call($method, $params) |
||
61 | |||
62 | /** |
||
63 | * @param $id |
||
64 | * |
||
65 | * @return $this |
||
66 | */ |
||
67 | public function whereId($id) |
||
73 | |||
74 | /** |
||
75 | * Set's. |
||
76 | * |
||
77 | * @param $key |
||
78 | * @param $value |
||
79 | */ |
||
80 | public function setNotFiltered($key, $value) |
||
86 | |||
87 | public function whereIds($ids) |
||
93 | } |
||
94 |
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: