1 | <?php |
||
16 | class ProductBacklogObserver |
||
17 | { |
||
18 | public function creating(ProductBacklog $productBacklog) |
||
19 | { |
||
20 | if (!isset($productBacklog->user_id)) { |
||
21 | $productBacklog->user_id = Auth::user()->id; |
||
|
|||
22 | } |
||
23 | |||
24 | $productBacklog->slug = Helper::slug($productBacklog->title); |
||
25 | if (isset($productBacklog->is_api)) { |
||
26 | $owner = Organization::find($productBacklog->organization_id); |
||
27 | $productBacklog::$tmp = app(Auth::user()->provider)->createOrUpdateRepository($owner->username, $productBacklog); |
||
28 | } |
||
29 | } |
||
30 | |||
31 | public function created(ProductBacklog $productBacklog) |
||
32 | { |
||
33 | if (isset($productBacklog->is_api)) { |
||
34 | $template = app(Auth::user()->provider)->tplRepository($productBacklog::$tmp, $productBacklog->slug); |
||
35 | $obj = ProductBacklog::slug($template->slug)->first(); |
||
36 | $obj->update(get_object_vars($template)); |
||
37 | $productBacklog::$tmp = null; |
||
38 | } |
||
39 | } |
||
40 | |||
41 | public function updating(ProductBacklog $productBacklog) |
||
51 | } |
||
52 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write 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.