Organization::getId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
use App\Model\Organization as OrganizationModel;
8
9
/**
10
 * @ORM\Entity()
11
 * @ORM\Table()
12
 * @ORM\HasLifecycleCallbacks
13
 */
14
class Organization extends OrganizationModel
15
{
16
    /**
17
     * @var integer
18
     *
19
     * @ORM\Id
20
     * @ORM\GeneratedValue(strategy="AUTO")
21
     * @ORM\Column(type="integer")
22
     */
23
    protected $id;
24
    /**
25
     * @ORM\Column(type="string", length=125)
26
     */
27
    protected $name;
28
    /**
29
     * @ORM\Column(type="string", length=125)
30
     */
31
    protected $slug;
32
    /**
33
     * @ORM\Column(type="string", length=25) 
34
     */
35
    protected $type;
36
    /**
37
     * @ORM\Column(type="text")
38
     */
39
    protected $description;
40
    /**
41
     * @ORM\Column(type="datetime")
42
     */
43
    protected $createdAt;
44
    /**
45
     * @ORM\Column(type="datetime")
46
     */
47
    protected $updatedAt;
48
    
49
    /**
50
     * @ORM\PrePersist()
51
     */
52 4
    public function prePersist()
53
    {
54 4
        $this->createdAt = $this->updatedAt = new \DateTime();
55 4
    }
56
57
    /**
58
     * @ORM\PreUpdate()
59
     */
60
    public function preUpdate()
61
    {
62
        $this->updatedAt = new \DateTime();
63
    }
64
65 3
    public function setId($id): Organization
66
    {
67 3
        $this->id = $id;
68
69 3
        return $this;
70
    }
71
72 3
    public function getId(): int
73
    {
74 3
        return $this->id;
75
    }
76
}
77