Completed
Push — master ( 3b5087...2fd7fd )
by Johannes
02:01
created

Page::isDraft()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Lichtenwallner  (https://lichtenwallner.at)
4
 *
5
 * @see https://github.com/jolicht/markdown-cms for the canonical source repository
6
 * @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT
7
 * @copyright Copyright (c) Johannes Lichtenwallner
8
 */
9
declare(strict_types = 1);
10
namespace Jolicht\MarkdownCms\ContentType;
11
12
/**
13
 * Content Type Page
14
 */
15
class Page
16
{
17
    /**
18
     * Id
19
     *
20
     * @var string
21
     */
22
    private $id;
23
24
    /**
25
     * Title
26
     *
27
     * @var string
28
     */
29
    private $title;
30
31
    /**
32
     * Date created
33
     *
34
     * @var \DateTime
35
     */
36
    private $created;
37
38
    /**
39
     * Date updated
40
     *
41
     * @var \DateTime
42
     */
43
    private $updated;
44
45
    /**
46
     * Is draft
47
     *
48
     * @var boolean
49
     */
50
    private $draft;
51
52
    /**
53
     *
54
     */
55
    public function __construct(string $id, string $title, \DateTime $created, \DateTime $updated, bool $draft)
56
    {
57
        $this->id = $id;
58
        $this->title = $title;
59
        $this->created = $created;
60
        $this->updated = $updated;
61
        $this->draft = $draft;
62
    }
63
64
    /**
65
     * Get id
66
     *
67
     * @return string
68
     */
69
    public function getId() : string
70
    {
71
        return $this->id;
72
    }
73
74
    /**
75
     * Get title
76
     *
77
     * @return string
78
     */
79
    public function getTitle() : string
80
    {
81
        return $this->title;
82
    }
83
84
    /**
85
     * Get date created
86
     *
87
     * @return \DateTime
88
     */
89
    public function getCreated() : \DateTime
90
    {
91
        return $this->created;
92
    }
93
94
    /**
95
     * Get date updated
96
     *
97
     * @return \DateTime
98
     */
99
    public function getUpdated() : \DateTime
100
    {
101
        return $this->updated;
102
    }
103
104
    /**
105
     * Is draft
106
     *
107
     * @return boolean
108
     */
109
    public function isDraft(): bool
110
    {
111
        return $this->draft;
112
    }
113
114
}