Passed
Pull Request — development (#682)
by Thomas
06:58
created

FieldNoteEntity::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\FieldNotes\Persistence;
4
5
use DateTime;
6
use Oc\GeoCache\Persistence\GeoCache\GeoCacheEntity;
7
use Oc\Repository\AbstractEntity;
8
9
class FieldNoteEntity extends AbstractEntity
10
{
11
    /**
12
     * @var int
13
     */
14
    public $id;
15
16
    /**
17
     * @var int
18
     */
19
    public $userId;
20
21
    /**
22
     * @var int
23
     */
24
    public $geocacheId;
25
26
    /**
27
     * @var int
28
     */
29
    public $type;
30
31
    /**
32
     * @var DateTime
0 ignored issues
show
introduced by
DateTime => \DateTime
Loading history...
33
     */
34
    public $date;
35
36
    /**
37
     * @var string
38
     */
39
    public $text;
40
41
    /**
42
     * @var GeoCacheEntity
0 ignored issues
show
introduced by
GeoCacheEntity => \Oc\GeoCache\Persistence\GeoCache\GeoCacheEntity
Loading history...
43
     */
44
    public $geoCache;
45
46
    /**
47
     * Checks if the entity is new.
48
     *
49
     * @return bool
50
     */
51
    public function isNew()
52
    {
53
        return $this->id === null;
54
    }
55
}
56