1 | <?php |
||
21 | trait MutualQueryTrait |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * Get the opposite relation. |
||
26 | * @param BaseUserModel|string $user initiator |
||
27 | * @param BaseUserModel|string $other recipient. |
||
28 | * @param Connection $database |
||
29 | * @return |
||
30 | */ |
||
31 | 8 | public function opposite($user, $other, $database = null) |
|
36 | |||
37 | /** |
||
38 | * Get all the opposites. |
||
39 | * @param string $user initator. |
||
40 | * @param array $others all recipients. |
||
41 | * @param Connection $database |
||
42 | * @return array instances. |
||
43 | */ |
||
44 | 8 | public function opposites($user, $others = [], $database = null) |
|
53 | |||
54 | /** |
||
55 | * Specify initiators. |
||
56 | * @param string|array $users the guid of initiator if string, or guid array |
||
57 | * of initiators if array. |
||
58 | * @return \static $this |
||
59 | */ |
||
60 | 10 | public function initiators($users = []) |
|
68 | |||
69 | /** |
||
70 | * Specify recipients. |
||
71 | * @param string|array $users the guid of recipient if string, or guid array |
||
72 | * of recipients if array. |
||
73 | * @return \static $this |
||
74 | */ |
||
75 | 14 | public function recipients($users = []) |
|
83 | } |
||
84 |
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: