Completed
Branch dev-record-extra-information (46ca32)
by Tyler
03:17
created

ExceptionModel::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Tylercd100\LERN\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class ExceptionModel extends Model {
8
    protected $table;
9
    protected $guarded = array('id');
10
11 3
    public function __construct(array $attributes = [])
12
    {
13 3
        $this->table = config('lern.record.table');
14 3
        parent::__construct($attributes);
15 3
    }
16
17
    public function setDataAttribute($value){
18
        $this->attributes['data'] = json_encode($value);
19
    }
20
21
    public function getDataAttribute($value){
22
        return json_decode($value);
23
    }
24
}