1 | <?php |
||
28 | trait BlameableQueryTrait |
||
29 | { |
||
30 | use QueryTrait; |
||
31 | |||
32 | /** |
||
33 | * Specify confirmation. |
||
34 | * @param boolean $isConfirmed |
||
35 | * @return $this |
||
36 | */ |
||
37 | public function confirmed($isConfirmed = true) |
||
45 | |||
46 | /** |
||
47 | * Specify content. |
||
48 | * @param mixed $content |
||
49 | * @param false|string $like false, 'like', 'or like', 'not like', 'or not like'. |
||
50 | * @return $this |
||
51 | */ |
||
52 | 3 | public function content($content, $like = false) |
|
53 | { |
||
54 | 3 | $model = $this->noInitModel; |
|
55 | 3 | return $this->likeCondition($content, $model->contentAttribute, $like); |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * Specify parent. |
||
60 | * @param array|string $guid parent guid or array of them. non-parent if |
||
61 | * empty. If you don't want to specify parent, please do not access this |
||
62 | * method. |
||
63 | * @return $this |
||
64 | */ |
||
65 | public function parentGuid($guid) |
||
76 | |||
77 | /** |
||
78 | * Specify creator(s). |
||
79 | * @param string|array $guid |
||
80 | * @return $this |
||
81 | */ |
||
82 | 17 | public function createdBy($guid) |
|
93 | |||
94 | /** |
||
95 | * Specify last updater(s). |
||
96 | * @param string|array $guid |
||
97 | * @return $this |
||
98 | */ |
||
99 | public function updatedBy($guid) |
||
110 | |||
111 | /** |
||
112 | * Attach current identity to createdBy condition. |
||
113 | * @param \vistart\Models\models\BaseUserModel $identity |
||
114 | * @return $this |
||
115 | */ |
||
116 | 9 | public function byIdentity($identity = null) |
|
126 | } |
||
127 |
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: