Subversion-Projekte lars-tiefland.webanos.faltradxxs.de

Revision

Revision 2 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
<?php
2
 
24 lars 3
    namespace App\Models;
2 lars 4
 
24 lars 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;
2 lars 11
 
24 lars 12
    class Order extends Model
13
    {
14
        use HasFactory;
15
 
16
        /**
17
         * The connection name for the model.
18
         *
19
         * @var string
20
         */
21
        protected $connection = 'order';
22
 
23
        public function orderItem(): HasMany
24
        {
25
            return $this->hasMany( OrderItem::class )->orderBy( 'rank' );
26
        }
27
 
28
        public function orderType(): BelongsTo
29
        {
30
            return $this->belongsTo( OrderType::class );
31
 
32
        }
33
 
34
        public function billAddr(): BelongsTo
35
        {
36
            return $this->belongsTo( OrderAddress::class, 'bill_addr_id' );
37
        }
38
        public function shop(): BelongsTo
39
        {
40
            return $this->belongsTo( Shop::class );
41
        }
42
 
43
        public function shipAddr(): BelongsTo
44
        {
45
            return $this->belongsTo( OrderAddress::class, 'ship_addr_id' );
46
        }
47
    }