1 | <?php |
||
26 | class BaseMongoBlameableQuery extends BaseMongoEntityQuery |
||
27 | { |
||
28 | use BlameableQueryTrait; |
||
29 | |||
30 | /** |
||
31 | * Specify creator(s). |
||
32 | * @param string|array $guid |
||
33 | * @return $this |
||
34 | */ |
||
35 | 9 | public function createdBy($guid) |
|
36 | { |
||
37 | 9 | $model = $this->noInitModel; |
|
38 | 9 | if (!is_string($model->createdByAttribute)) { |
|
|
|||
39 | return $this; |
||
40 | } |
||
41 | 9 | if ($guid instanceof BaseUserModel) { |
|
42 | 3 | $guid = $guid->getGUID(); |
|
43 | } |
||
44 | 9 | return $this->andWhere([$model->createdByAttribute => new Binary($guid, Binary::TYPE_UUID)]); |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * Specify last updater(s). |
||
49 | * @param string|array $guid |
||
50 | * @return $this |
||
51 | */ |
||
52 | 4 | public function updatedBy($guid) |
|
53 | { |
||
54 | 4 | $model = $this->noInitModel; |
|
55 | 4 | if (!is_string($model->updatedByAttribute)) { |
|
56 | 1 | return $this; |
|
57 | } |
||
58 | 3 | if ($guid instanceof BaseUserModel) { |
|
59 | 3 | $guid = $guid->getGUID(); |
|
60 | } |
||
61 | 3 | return $this->andWhere([$model->updatedByAttribute => new Binary($guid, Binary::TYPE_UUID)]); |
|
62 | } |
||
63 | |||
64 | /** |
||
65 | * Attach current identity to createdBy condition. |
||
66 | * @param BaseUserModel $identity |
||
67 | * @return $this |
||
68 | */ |
||
69 | 6 | public function byIdentity($identity = null) |
|
79 | } |
||
80 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.