1 | <?php |
||
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() { |
||
73 | |||
74 | /** |
||
75 | * @ORM\PreUpdate() |
||
76 | */ |
||
77 | public function preUpdate() { |
||
80 | |||
81 | /** |
||
82 | * @param integer $id |
||
83 | * @return Project |
||
84 | */ |
||
85 | 4 | public function setId($id) { |
|
90 | |||
91 | /** |
||
92 | * Get id |
||
93 | * |
||
94 | * @return int |
||
95 | */ |
||
96 | 3 | public function getId() |
|
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: