Passed
Pull Request — development (#682)
by Nick
07:18
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
/**
10
 * Class FieldNoteEntity
11
 *
12
 * @package Oc\FieldNotes\Persistence
0 ignored issues
show
introduced by
Unexpected tag type @package in doc block
Loading history...
13
 */
14
class FieldNoteEntity extends AbstractEntity
15
{
16
    /**
17
     * @var int
18
     */
19
    public $id;
20
21
    /**
22
     * @var int
23
     */
24
    public $userId;
25
26
    /**
27
     * @var int
28
     */
29
    public $geocacheId;
30
31
    /**
32
     * @var int
33
     */
34
    public $type;
35
36
    /**
37
     * @var DateTime
0 ignored issues
show
introduced by
DateTime => \DateTime
Loading history...
38
     */
39
    public $date;
40
41
    /**
42
     * @var string
43
     */
44
    public $text;
45
46
    /**
47
     * @var GeoCacheEntity
0 ignored issues
show
introduced by
GeoCacheEntity => \Oc\GeoCache\Persistence\GeoCache\GeoCacheEntity
Loading history...
48
     */
49
    public $geoCache;
50
51
    /**
52
     * Checks if the entity is new.
53
     *
54
     * @return bool
55
     */
56
    public function isNew()
57
    {
58
        return $this->id === null;
59
    }
60
}
61