Completed
Push — master ( b1c4b6...a05019 )
by Şəhriyar
19s
created

UserActivation::getCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php namespace App\Models;
2
3
use Illuminate\Database\Eloquent\Model;
4
5
/**
6
 * App\Models\UserActivation
7
 *
8
 * @mixin \Eloquent
9
 * @property integer        $id
10
 * @property integer        $user_id
11
 * @property string         $code
12
 * @property boolean        $completed
13
 * @property string         $completed_at
14
 * @property \Carbon\Carbon $created_at
15
 * @property \Carbon\Carbon $updated_at
16
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereId($value)
17
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereUserId($value)
18
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereCode($value)
19
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereCompleted($value)
20
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereCompletedAt($value)
21
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereCreatedAt($value)
22
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserActivation whereUpdatedAt($value)
23
 */
24
class UserActivation extends Model
25
{
26
    protected $table = 'users_activations';
27
28
    protected $fillable = [
29
        'code',
30
        'completed',
31
        'completed_at',
32
    ];
33
34
    /**
35
     * @param  mixed $completed
36
     *
37
     * @return bool
38
     */
39
    public function getCompleted($completed)
40
    {
41
        return (bool)$completed;
42
    }
43
44
    /**
45
     * @param  mixed $completed
46
     *
47
     * @return void
48
     */
49
    public function setCompleted($completed)
50
    {
51
        $this->attributes['completed'] = (bool)$completed;
52
    }
53
54
    public function getCode()
55
    {
56
        return $this->attributes['code'];
57
    }
58
}
59