Domain   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 47
ccs 0
cts 3
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A referers() 0 6 1
1
<?php namespace Arcanedev\LaravelTracker\Models;
2
3
use Arcanedev\LaravelTracker\Contracts\Models\Domain as DomainContract;
4
use Arcanedev\LaravelTracker\Support\BindingManager;
5
6
/**
7
 * Class     Domain
8
 *
9
 * @package  Arcanedev\LaravelTracker\Models
10
 * @author   ARCANEDEV <[email protected]>
11
 *
12
 * @property  int             id
13
 * @property  string          name
14
 * @property  \Carbon\Carbon  created_at
15
 * @property  \Carbon\Carbon  updated_at
16
 *
17
 * @property  \Illuminate\Database\Eloquent\Collection  referers
18
 */
19
class Domain extends AbstractModel implements DomainContract
20
{
21
    /* -----------------------------------------------------------------
22
     |  Properties
23
     | -----------------------------------------------------------------
24
     */
25
26
    /**
27
     * The table associated with the model.
28
     *
29
     * @var string
30
     */
31
    protected $table = 'domains';
32
33
    /**
34
     * The attributes that are mass assignable.
35
     *
36
     * @var array
37
     */
38
    protected $fillable = ['name'];
39
40
    /**
41
     * The attributes that should be cast to native types.
42
     *
43
     * @var array
44
     */
45
    protected $casts = [
46
        'id' => 'integer',
47
    ];
48
49
    /* -----------------------------------------------------------------
50
     |  Relationships
51
     | -----------------------------------------------------------------
52
     */
53
54
    /**
55
     * Referer relationship.
56
     *
57
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
58
     */
59
    public function referers()
60
    {
61
        return $this->hasMany(
62
            $this->getModelClass(BindingManager::MODEL_REFERER, Referer::class)
63
        );
64
    }
65
}
66