Completed
Push — master ( 46961e...b2acd3 )
by Axel
04:17 queued 01:11
created

Job   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 72.72%

Importance

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

4 Methods

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