Completed
Push — master ( b1d633...cf519d )
by Maxime
12:25
created

Asset   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 46
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getUrl() 0 4 1
1
<?php
2
3
namespace Distilleries\Contentful\Models;
4
5
use Distilleries\Contentful\Models\Traits\Localable;
6
use Illuminate\Database\Eloquent\Model;
7
use Illuminate\Database\Eloquent\Builder;
8
9
/**
10
 * @property string $contentful_id
11
 * @property string $locale
12
 * @property string $title
13
 * @property string $description
14
 * @property string $url
15
 * @property string $file_name
16
 * @property string $content_type
17
 * @property integer $size
18
 * @property integer $width
19
 * @property integer $height
20
 * @property \Illuminate\Support\Carbon $created_at
21
 * @property \Illuminate\Support\Carbon $updated_at
22
 */
23
class Asset extends Model
24
{
25
    use Localable;
26
    /**
27
     * {@inheritdoc}
28
     */
29
    protected $table = 'assets';
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    protected $fillable = [
35
        'contentful_id',
36
        'country',
37
        'locale',
38
        'title',
39
        'description',
40
        'url',
41
        'file_name',
42
        'content_type',
43
        'size',
44
        'width',
45
        'height',
46
    ];
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    protected $casts = [
52
        'size' => 'integer',
53
        'width' => 'integer',
54
        'height' => 'integer',
55
    ];
56
57
58
    /**
59
     * Return asset URL.
60
     *
61
     * @return string
62
     */
63
    public function getUrl()
64
    {
65
        return $this->url;
66
    }
67
68
}
69