Subversion-Projekte lars-tiefland.webanos.marine-sales.de

Revision

Zur aktuellen Revision | Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
<?php
2
 
3
    namespace App\Models;
4
 
5
    use Illuminate\Database\Eloquent\Factories\HasFactory;
6
    use Illuminate\Database\Eloquent\Model;
7
    use Illuminate\Database\Eloquent\Relations\BelongsTo;
8
    use Illuminate\Database\Eloquent\Relations\BelongsToMany;
9
    use Illuminate\Database\Eloquent\Relations\HasMany;
10
    use Illuminate\Database\Eloquent\Relations\HasOne;
11
 
12
    class Order extends Model
13
    {
14
        use HasFactory;
15
 
16
        public function orderItem(): HasMany
17
        {
18
            return $this->hasMany( OrderItem::class )->orderBy( 'rank' );
19
        }
20
 
21
        public function orderType(): BelongsTo
22
        {
23
            return $this->belongsTo( OrderType::class );
24
 
25
        }
26
 
27
        public function billAddr(): BelongsTo
28
        {
29
            return $this->belongsTo( OrderAddress::class, 'bill_addr_id' );
30
        }
31
        public function shop(): BelongsTo
32
        {
33
            return $this->belongsTo( Shop::class );
34
        }
35
 
36
        public function shipAddr(): BelongsTo
37
        {
38
            return $this->belongsTo( OrderAddress::class, 'ship_addr_id' );
39
        }
40
    }