Completed
Push — master ( 7f6216...ac54c1 )
by Freek
01:23
created

CampaignOpen   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 19
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A campaignSend() 0 4 1
A campaign() 0 4 1
A subscriber() 0 4 1
1
<?php
2
3
namespace Spatie\EmailCampaigns\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\Relations\BelongsTo;
7
8
class CampaignOpen extends Model
9
{
10
    protected $guarded = [];
11
12
    public function campaignSend(): BelongsTo
13
    {
14
        return $this->belongsTo(CampaignSend::class, 'email_campaign_send_id');
15
    }
16
17
    public function campaign(): BelongsTo
18
    {
19
        return $this->belongsTo(Campaign::class, 'email_campaign_id');
20
    }
21
22
    public function subscriber(): BelongsTo
23
    {
24
        return $this->belongsTo(Subscriber::class, 'email_list_subscriber_id');
25
    }
26
}
27