Completed
Pull Request — develop (#39)
by Axel
03:13
created

Feedback   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 79
ccs 5
cts 5
cp 1
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A prePersist() 0 3 1
A preUpdate() 0 3 1
A setId() 0 5 1
A getId() 0 4 1
1
<?php
2
3
namespace Developtech\AgilityBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
use Developtech\AgilityBundle\Model\FeedbackModel;
8
9
/**
10
 * Feedback
11
 *
12
 * @ORM\Entity(repositoryClass="Developtech\AgilityBundle\Repository\FeedbackRepository")
13
 * @ORM\Table(name="developtech_agility__feedbacks")
14
 * @ORM\HasLifecycleCallbacks()
15
 */
16
class Feedback extends FeedbackModel {
17
    /**
18
     * @ORM\Column(name="id", type="integer")
19
     * @ORM\Id
20
     * @ORM\GeneratedValue(strategy="AUTO")
21
     */
22
    protected $id;
23
24
    /**
25
     * @ORM\Column(name="name", type="string", length=125)
26
     */
27
    protected $name;
28
29
    /**
30
     * @ORM\Column(name="slug", type="string", length=125)
31
     */
32
    protected $slug;
33
34
    /**
35
     * @ORM\Column(name="description", type="string", length=255)
36
     */
37
    protected $description;
38
39
    /**
40
     * @ORM\Column(name="status", type="integer")
41
     */
42
    protected $status;
43
44
    /**
45
     * @ORM\Column(name="createdAt", type="datetime")
46
     */
47
    protected $createdAt;
48
49
    /**
50
     * @ORM\Column(name="updatedAt", type="datetime")
51
     */
52
    protected $updatedAt;
53
54
    /**
55
     * @var Project
56
     *
57
     * @ORM\ManyToOne(targetEntity="Developtech\AgilityBundle\Entity\Project", inversedBy="feedbacks")
58
     */
59
    protected $project;
60
61
    /**
62
     * @ORM\PrePersist()
63
     */
64
    public function prePersist() {
65
        $this->createdAt = $this->updatedAt = new \DateTime();
66
    }
67
68
    /**
69
     * @ORM\PreUpdate()
70
     */
71
    public function preUpdate() {
72
        $this->updatedAt = new \DateTime();
73
    }
74
75
    /**
76
     * @param integer $id
77
     * @return FeedbackModel
78
     */
79 2
    public function setId($id) {
80 2
        $this->id = $id;
81
82 2
        return $this;
83
    }
84
85
    /**
86
     * Get id
87
     *
88
     * @return int
89
     */
90 3
    public function getId()
91
    {
92 3
        return $this->id;
93
    }
94
}
95