Content   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A revisions() 0 4 1
1
<?php
2
3
/**
4
 * A content is the base brick of the Entity system.
5
 *
6
 * The Content holds the Revision which in turn holds the Fields.
7
 */
8
namespace Rocket\Entities;
9
10
use Illuminate\Database\Eloquent\Model;
11
12
/**
13
 * Represent a Content
14
 *
15
 * @property int $id The field id
16
 * @property bool $published the published state
17
 * @property string $type the type of the entity
18
 * @property Revision[] $revisions the revisions attached to this content
19
 * @property-read \DateTime $created_at
20
 * @property-read \DateTime $updated_at
21
 */
22
class Content 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
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
43
     */
44
    public function revisions()
45
    {
46
        return $this->hasMany(Revision::class);
47
    }
48
}
49