1 | <?php |
||
33 | trait CrudTrait |
||
34 | { |
||
35 | /** |
||
36 | * Create a new note. |
||
37 | * |
||
38 | * @param array $input |
||
39 | * |
||
40 | * @return $this |
||
41 | */ |
||
42 | 2 | public function createNote(array $input) |
|
43 | { |
||
44 | 2 | $this->body = $input['note_body']; |
|
45 | 2 | $this->project_id = $this->project->id; |
|
46 | 2 | $this->created_by = $this->createdBy->id; |
|
47 | |||
48 | // Add event on successful save |
||
49 | 2 | static::saved([$this, 'queueAdd']); |
|
50 | |||
51 | 2 | $this->save(); |
|
52 | |||
53 | // Add to user's activity log |
||
54 | 2 | $this->activity()->save(new Model\User\Activity([ |
|
55 | 2 | 'type_id' => Model\Activity::TYPE_NOTE, |
|
56 | 2 | 'parent_id' => $this->project->id, |
|
57 | 2 | 'user_id' => $this->createdBy->id, |
|
58 | ])); |
||
59 | |||
60 | 2 | return $this; |
|
61 | } |
||
62 | |||
63 | /** |
||
64 | * Update the note body. |
||
65 | * |
||
66 | * @param string $body |
||
67 | * |
||
68 | * @return Eloquent\Model |
||
69 | */ |
||
70 | 1 | public function updateBody($body) |
|
79 | |||
80 | /** |
||
81 | * Delete a note. |
||
82 | * |
||
83 | * @return bool|null |
||
84 | * |
||
85 | * @throws \Exception |
||
86 | */ |
||
87 | 1 | public function delete() |
|
96 | } |
||
97 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.