AbstractContentType::getUpdated()   A
last analyzed

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
abstract class AbstractContentType
13
{
14
15
    /**
16
     * Id
17
     *
18
     * @var string
19
     */
20
    private $id;
21
22
    /**
23
     * Title
24
     *
25
     * @var string
26
     */
27
    private $title;
28
29
    /**
30
     * Content
31
     *
32
     * @var string
33
     */
34
    private $content;
35
36
    /**
37
     * Date created
38
     *
39
     * @var \DateTime
40
     */
41
    private $created;
42
43
    /**
44
     * Date updated
45
     *
46
     * @var \DateTime
47
     */
48
    private $updated;
49
50
    /**
51
     * Is draft
52
     *
53
     * @var boolean
54
     */
55
    private $draft;
56
57
    /**
58
     * Template
59
     *
60
     * @var string
61
     */
62
    private $template;
63
64
    /**
65
     * Constructor
66
     *
67
     * @param string $id
68
     * @param string $title
69
     * @param string $content
70
     * @param \DateTime $created
71
     * @param \DateTime $updated
72
     * @param bool $draft
73
     * @param string $template
74
     */
75
    public function __construct(string $id, string $title, string $content, \DateTime $created, \DateTime $updated,
76
        bool $draft, string $template)
77
    {
78
        $this->id = $id;
79
        $this->title = $title;
80
        $this->content = $content;
81
        $this->created = $created;
82
        $this->updated = $updated;
83
        $this->draft = $draft;
84
        $this->template = $template;
85
    }
86
87
    /**
88
     * Get id
89
     *
90
     * @return string
91
     */
92
    public function getId(): string
93
    {
94
        return $this->id;
95
    }
96
97
    /**
98
     * Get title
99
     *
100
     * @return string
101
     */
102
    public function getTitle(): string
103
    {
104
        return $this->title;
105
    }
106
107
    /**
108
     * Get content
109
     *
110
     * @return string
111
     */
112
    public function getContent(): string
113
    {
114
        return $this->content;
115
    }
116
117
    /**
118
     * Get date created
119
     *
120
     * @return \DateTime
121
     */
122
    public function getCreated(): \DateTime
123
    {
124
        return $this->created;
125
    }
126
127
    /**
128
     * Get date updated
129
     *
130
     * @return \DateTime
131
     */
132
    public function getUpdated(): \DateTime
133
    {
134
        return $this->updated;
135
    }
136
137
    /**
138
     * Is draft
139
     *
140
     * @return boolean
141
     */
142
    public function isDraft(): bool
143
    {
144
        return $this->draft;
145
    }
146
147
    /**
148
     * Get template
149
     *
150
     * @return string
151
     */
152
    public function getTemplate() : string
153
    {
154
        return $this->template;
155
    }
156
157
    /**
158
     * Get type
159
     *
160
     * @return string
161
     */
162
    abstract public function getType() : string;
163
}
164
165