| Total Complexity | 4 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | trait Relation |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * Define an inverse one-to-one or many relationship with \App\Models\Order. |
||
| 22 | * |
||
| 23 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
| 24 | */ |
||
| 25 | public function order(): BelongsTo |
||
| 26 | { |
||
| 27 | return $this->belongsTo(Order::class); |
||
|
|
|||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Return \App\Models\Order model relation value. |
||
| 32 | * |
||
| 33 | * @return \App\Models\Order |
||
| 34 | */ |
||
| 35 | public function getOrderRelationValue(): Order |
||
| 36 | { |
||
| 37 | return $this->getRelationValue('order'); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Set \App\Models\Order model relation value. |
||
| 42 | * |
||
| 43 | * @param \App\Models\Order $order |
||
| 44 | * @return $this |
||
| 45 | */ |
||
| 46 | public function setOrderRelationValue(Order $order) |
||
| 47 | { |
||
| 48 | $this->order()->associate($order); |
||
| 49 | |||
| 50 | return $this; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Define a polymorphic, inverse one-to-one or many relationship. |
||
| 55 | * |
||
| 56 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
||
| 57 | * |
||
| 58 | * @see \App\Models\Customer |
||
| 59 | * @see \App\Models\User |
||
| 60 | */ |
||
| 61 | public function issuerable(): MorphTo |
||
| 64 | } |
||
| 65 | } |
||
| 66 |