Revision   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A content() 0 4 1
1
<?php
2
/**
3
 * Represents a revision.
4
 *
5
 * A revision is a instance of a content with a language.
6
 */
7
namespace Rocket\Entities;
8
9
use Illuminate\Database\Eloquent\Model;
10
11
/**
12
 * A revision is the status of a content at a certain moment in time
13
 *
14
 * @property int $id The field id
15
 * @property int $language_id the language of this revision
16
 * @property int $content_id the content this revision is related to
17
 * @property bool $published the published state
18
 * @property Content $content the content this revision is linked to
19
 * @property-read \DateTime $created_at
20
 * @property-read \DateTime $updated_at
21
 */
22
class Revision extends Model
23
{
24
    /**
25
     * @var array The attributes that should be cast to native types.
26
     */
27
    protected $casts = [
28
        'published' => 'boolean',
29
    ];
30
31
    /**
32
     * @var array The model's attributes.
33
     */
34
    protected $attributes = [
35
        'published' => true,
36
    ];
37
38
    /**
39
     * Get the revisions for this class
40
     *
41
     * @codeCoverageIgnore
42
     */
43
    public function content()
44
    {
45
        return $this->belongsTo(Content::class);
46
    }
47
}
48