SubscriptionPeriod::subscription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file implements Subscription Period.
4
 *
5
 * @author    Bilal Gultekin <[email protected]>
6
 * @author    Justin Hartman <[email protected]>
7
 * @copyright 2019 22 Digital
8
 * @license   MIT
9
 * @since     v0.1
10
 */
11
12
namespace TwentyTwoDigital\CashierFastspring;
13
14
use Illuminate\Database\Eloquent\Model;
15
16
/**
17
 * This class describes a subscription period.
18
 *
19
 * {@inheritdoc}
20
 */
21
class SubscriptionPeriod extends Model
22
{
23
    /**
24
     * The attributes that are not mass assignable.
25
     *
26
     * @var array
27
     */
28
    protected $guarded = [];
29
30
    /**
31
     * The attributes that should be mutated to dates.
32
     *
33
     * @var array
34
     */
35
    protected $dates = [
36
        'start_date', 'end_date',
37
        'created_at', 'updated_at',
38
    ];
39
40
    /**
41
     * Get the user that owns the subscription.
42
     *
43
     * @return object Subscription object.
44
     */
45 1
    public function subscription()
46
    {
47 1
        return $this->belongsTo('TwentyTwoDigital\CashierFastspring\Subscription');
48
    }
49
}
50