1 | <?php |
||
26 | trait CrudTrait |
||
27 | { |
||
28 | /** |
||
29 | * Insert a record into the message queue. |
||
30 | * |
||
31 | * @param string $name |
||
32 | * @param Model $model |
||
33 | * @param int|User $changeBy |
||
34 | * |
||
35 | * @return void |
||
36 | */ |
||
37 | public function queue($name, Model $model, $changeBy) |
||
62 | |||
63 | /** |
||
64 | * Insert a record into the message queue about a delete event. |
||
65 | * |
||
66 | * @param string $name |
||
67 | * @param Model $model |
||
68 | * @param int|User $changeBy |
||
69 | * |
||
70 | * @return void |
||
71 | */ |
||
72 | public function queueDelete($name, Model $model, $changeBy) |
||
82 | |||
83 | /** |
||
84 | * Insert records about tag changes into the message queue. |
||
85 | * |
||
86 | * @param Issue $issue |
||
87 | * @param array $added |
||
88 | * @param array $removed |
||
89 | * @param User $changeBy |
||
90 | * |
||
91 | * @return mixed |
||
92 | */ |
||
93 | public function queueIssueTagChanges(Issue $issue, array $added, array $removed, User $changeBy) |
||
103 | |||
104 | /** |
||
105 | * Returns an array containing the data needed for the message queue save. |
||
106 | * |
||
107 | * @param string $name |
||
108 | * @param Model $model |
||
109 | * @param int|User $changeBy |
||
110 | * @param array $payload |
||
111 | * |
||
112 | * @return array |
||
113 | */ |
||
114 | protected function getFillAttributes($name, Model $model, $changeBy, array $payload) |
||
127 | |||
128 | abstract public function fill(array $attributes); |
||
129 | } |
||
130 |