Completed
Pull Request — development (#546)
by Nick
06:21
created

PageEntity::isNew()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Oc\Page;
4
5
use DateTime;
6
use Oc\Repository\AbstractEntity;
7
8
/**
9
 * Class PageEntity
10
 *
11
 * @package Oc\Page
12
 */
13
class PageEntity extends AbstractEntity
14
{
15
    /**
16
     * @var int
17
     */
18
    public $id;
19
20
    /**
21
     * @var string
22
     */
23
    public $slug;
24
25
    /**
26
     * @var string
27
     */
28
    public $metaKeywords;
29
30
    /**
31
     * @var string
32
     */
33
    public $metaDescription;
34
35
    /**
36
     * @var string
37
     */
38
    public $metaSocial;
39
40
    /**
41
     * @var DateTime
42
     */
43
    public $updatedAt;
44
45
    /**
46
     * @var bool
47
     */
48
    public $active = true;
49
50
    /**
51
     * Checks if the entity is new.
52
     *
53
     * @return bool
54
     */
55
    public function isNew()
56
    {
57
        return $this->id === null;
58
    }
59
}
60