Organization   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Test Coverage

Coverage 72.72%

Importance

Changes 0
Metric Value
dl 0
loc 61
ccs 8
cts 11
cp 0.7272
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setId() 0 5 1
A prePersist() 0 3 1
A preUpdate() 0 3 1
A getId() 0 3 1
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