AchievementCriteriaModel   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A achievement() 0 4 1
1
<?php
2
3
namespace Laravel\Achievements;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class AchievementCriteriaModel
9
 *
10
 * @property int $id
11
 * @property int $achievement_id
12
 * @property string $type
13
 * @property string $name
14
 * @property int $max_value
15
 * @property array $requirements
16
 * @property \Carbon\Carbon $created_at
17
 * @property \Carbon\Carbon $updated_at
18
 * @property AchievementModel $achievement
19
 */
20
class AchievementCriteriaModel extends Model
21
{
22
    /**
23
     * @var string
24
     */
25
    protected $table = 'achievement_criterias';
26
27
    /**
28
     * @var array
29
     */
30
    protected $fillable = [
31
        'achievement_id', 'type', 'name',
32
        'max_value', 'requirements',
33
    ];
34
35
    /**
36
     * @var array
37
     */
38
    protected $casts = [
39
        'achievement_id' => 'integer',
40
        'max_value' => 'integer',
41
        'requirements' => 'array',
42
    ];
43
44
    /**
45
     * Achievement.
46
     *
47
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
48
     */
49
    public function achievement()
50
    {
51
        return $this->belongsTo(config('achievements.models.achievement'));
52
    }
53
}
54