Total Complexity | 3 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | trait BelongsToCreatedBy |
||
13 | { |
||
14 | /** |
||
15 | * Define an inverse one-to-one relationship with \App\Models\User. |
||
16 | * |
||
17 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
18 | */ |
||
19 | public function createdBy(): BelongsTo |
||
20 | { |
||
21 | return $this->belongsTo(User::class, 'created_by'); |
||
|
|||
22 | } |
||
23 | |||
24 | /** |
||
25 | * Return \App\Models\User model relation value. |
||
26 | * |
||
27 | * @return \App\Models\User |
||
28 | */ |
||
29 | public function getCreatedByRelationValue(): User |
||
30 | { |
||
31 | return $this->getRelationValue('created_by'); |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * Set \App\Models\User model relation value. |
||
36 | * |
||
37 | * @param \App\Models\User $user |
||
38 | * @return $this |
||
39 | */ |
||
40 | public function setCreatedByRelationValue(User $user) |
||
45 | } |
||
46 | } |
||
47 |