1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Developtech\AgilityBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
|
7
|
|
|
use Developtech\AgilityBundle\Model\ProjectModel; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* @ORM\Entity(repositoryClass="Developtech\AgilityBundle\Repository\ProjectRepository") |
11
|
|
|
* @ORM\Table(name="developtech_agility__projects") |
12
|
|
|
* @ORM\HasLifecycleCallbacks() |
13
|
|
|
*/ |
14
|
|
|
class Project extends ProjectModel |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* @ORM\Id |
18
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
19
|
|
|
* @ORM\Column(type="integer") |
20
|
|
|
*/ |
21
|
|
|
protected $id; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var string |
25
|
|
|
* |
26
|
|
|
* @ORM\Column(name="name", type="string", length=125, unique=true) |
27
|
|
|
*/ |
28
|
|
|
protected $name; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var string |
32
|
|
|
* |
33
|
|
|
* @ORM\Column(name="slug", type="string", length=125, unique=true) |
34
|
|
|
*/ |
35
|
|
|
protected $slug; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @ORM\Column(name="description", type="text") |
39
|
|
|
*/ |
40
|
|
|
protected $description; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @ORM\Column(name="created_at", type="datetime") |
44
|
|
|
*/ |
45
|
|
|
protected $createdAt; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @ORM\Column(name="nbBetaTesters", type="integer") |
49
|
|
|
*/ |
50
|
|
|
protected $nbBetaTesters; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @ORM\Column(name="betaTestStatus", type="string", length=12) |
54
|
|
|
*/ |
55
|
|
|
protected $betaTestStatus; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @ORM\OneToMany(targetEntity="Developtech\AgilityBundle\Entity\Feature", mappedBy="project") |
59
|
|
|
*/ |
60
|
|
|
protected $features; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @ORM\OneToMany(targetEntity="Developtech\AgilityBundle\Entity\Feedback", mappedBy="project") |
64
|
|
|
*/ |
65
|
|
|
protected $feedbacks; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @ORM\PrePersist() |
69
|
|
|
*/ |
70
|
|
|
public function prePersist() { |
71
|
|
|
$this->createdAt = new \DateTime(); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @ORM\PreUpdate() |
76
|
|
|
*/ |
77
|
|
|
public function preUpdate() { |
78
|
|
|
$this->updatedAt = new \DateTime(); |
|
|
|
|
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @param integer $id |
83
|
|
|
* @return Project |
84
|
|
|
*/ |
85
|
4 |
|
public function setId($id) { |
86
|
4 |
|
$this->id = $id; |
87
|
|
|
|
88
|
4 |
|
return $this; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* Get id |
93
|
|
|
* |
94
|
|
|
* @return int |
95
|
|
|
*/ |
96
|
3 |
|
public function getId() |
97
|
|
|
{ |
98
|
3 |
|
return $this->id; |
99
|
|
|
} |
100
|
|
|
} |
101
|
|
|
|
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: