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

ExceptionModel   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 44.44%

Importance

Changes 2
Bugs 1 Features 2
Metric Value
wmc 3
c 2
b 1
f 2
lcom 1
cbo 1
dl 0
loc 18
ccs 4
cts 9
cp 0.4444
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setDataAttribute() 0 3 1
A getDataAttribute() 0 3 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
}