1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
class Usecase extends \Phalcon\Mvc\Model |
|
|
|
|
4
|
|
|
{ |
5
|
|
|
|
6
|
|
|
/** |
7
|
|
|
* |
8
|
|
|
* @var string |
9
|
|
|
*/ |
10
|
|
|
protected $code; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* |
14
|
|
|
* @var string |
15
|
|
|
*/ |
16
|
|
|
protected $nom; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* |
20
|
|
|
* @var integer |
21
|
|
|
*/ |
22
|
|
|
protected $poids; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* |
26
|
|
|
* @var integer |
27
|
|
|
*/ |
28
|
|
|
protected $avancement; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* |
32
|
|
|
* @var integer |
33
|
|
|
*/ |
34
|
|
|
protected $idProjet; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* |
38
|
|
|
* @var integer |
39
|
|
|
*/ |
40
|
|
|
protected $idDev; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Method to set the value of field code |
44
|
|
|
* |
45
|
|
|
* @param string $code |
46
|
|
|
* @return $this |
47
|
|
|
*/ |
48
|
|
|
public function setCode($code) |
49
|
|
|
{ |
50
|
|
|
$this->code = $code; |
51
|
|
|
|
52
|
|
|
return $this; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Method to set the value of field nom |
57
|
|
|
* |
58
|
|
|
* @param string $nom |
59
|
|
|
* @return $this |
60
|
|
|
*/ |
61
|
|
|
public function setNom($nom) |
62
|
|
|
{ |
63
|
|
|
$this->nom = $nom; |
64
|
|
|
|
65
|
|
|
return $this; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Method to set the value of field poids |
70
|
|
|
* |
71
|
|
|
* @param integer $poids |
72
|
|
|
* @return $this |
73
|
|
|
*/ |
74
|
|
|
public function setPoids($poids) |
75
|
|
|
{ |
76
|
|
|
$this->poids = $poids; |
77
|
|
|
|
78
|
|
|
return $this; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* Method to set the value of field avancement |
83
|
|
|
* |
84
|
|
|
* @param integer $avancement |
85
|
|
|
* @return $this |
86
|
|
|
*/ |
87
|
|
|
public function setAvancement($avancement) |
88
|
|
|
{ |
89
|
|
|
$this->avancement = $avancement; |
90
|
|
|
|
91
|
|
|
return $this; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* Method to set the value of field idProjet |
96
|
|
|
* |
97
|
|
|
* @param integer $idProjet |
98
|
|
|
* @return $this |
99
|
|
|
*/ |
100
|
|
|
public function setIdProjet($idProjet) |
101
|
|
|
{ |
102
|
|
|
$this->idProjet = $idProjet; |
103
|
|
|
|
104
|
|
|
return $this; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* Method to set the value of field idDev |
109
|
|
|
* |
110
|
|
|
* @param integer $idDev |
111
|
|
|
* @return $this |
112
|
|
|
*/ |
113
|
|
|
public function setIdDev($idDev) |
114
|
|
|
{ |
115
|
|
|
$this->idDev = $idDev; |
116
|
|
|
|
117
|
|
|
return $this; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* Returns the value of field code |
122
|
|
|
* |
123
|
|
|
* @return string |
124
|
|
|
*/ |
125
|
|
|
public function getCode() |
126
|
|
|
{ |
127
|
|
|
return $this->code; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* Returns the value of field nom |
132
|
|
|
* |
133
|
|
|
* @return string |
134
|
|
|
*/ |
135
|
|
|
public function getNom() |
136
|
|
|
{ |
137
|
|
|
return $this->nom; |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* Returns the value of field poids |
142
|
|
|
* |
143
|
|
|
* @return integer |
144
|
|
|
*/ |
145
|
|
|
public function getPoids() |
146
|
|
|
{ |
147
|
|
|
return $this->poids; |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* Returns the value of field avancement |
152
|
|
|
* |
153
|
|
|
* @return integer |
154
|
|
|
*/ |
155
|
|
|
public function getAvancement() |
156
|
|
|
{ |
157
|
|
|
return $this->avancement; |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* Returns the value of field idProjet |
162
|
|
|
* |
163
|
|
|
* @return integer |
164
|
|
|
*/ |
165
|
|
|
public function getIdProjet() |
166
|
|
|
{ |
167
|
|
|
return $this->idProjet; |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
/** |
171
|
|
|
* Returns the value of field idDev |
172
|
|
|
* |
173
|
|
|
* @return integer |
174
|
|
|
*/ |
175
|
|
|
public function getIdDev() |
176
|
|
|
{ |
177
|
|
|
return $this->idDev; |
178
|
|
|
} |
179
|
|
|
|
180
|
|
|
/** |
181
|
|
|
* Initialize method for model. |
182
|
|
|
*/ |
183
|
|
|
public function initialize() |
184
|
|
|
{ |
185
|
|
|
$this->hasMany('code', 'Tache', 'codeUseCase', array('alias' => 'Taches')); |
186
|
|
|
$this->belongsTo('idProjet', 'Projet', 'id', array('alias' => 'Projet')); |
187
|
|
|
$this->belongsTo('idDev', 'User', 'id', array('alias' => 'User')); |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
/** |
191
|
|
|
* Returns table name mapped in the model. |
192
|
|
|
* |
193
|
|
|
* @return string |
194
|
|
|
*/ |
195
|
|
|
public function getSource() |
196
|
|
|
{ |
197
|
|
|
return 'usecase'; |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* Allows to query a set of records that match the specified conditions |
202
|
|
|
* |
203
|
|
|
* @param mixed $parameters |
204
|
|
|
* @return Usecase[] |
205
|
|
|
*/ |
206
|
|
|
public static function find($parameters = null) |
207
|
|
|
{ |
208
|
|
|
return parent::find($parameters); |
209
|
|
|
} |
210
|
|
|
|
211
|
|
|
/** |
212
|
|
|
* Allows to query the first record that match the specified conditions |
213
|
|
|
* |
214
|
|
|
* @param mixed $parameters |
215
|
|
|
* @return Usecase |
216
|
|
|
*/ |
217
|
|
|
public static function findFirst($parameters = null) |
218
|
|
|
{ |
219
|
|
|
return parent::findFirst($parameters); |
220
|
|
|
} |
221
|
|
|
|
222
|
|
|
public function toString(){ |
223
|
|
|
return $this->nom."(".$this->avancement.")"; |
224
|
|
|
} |
225
|
|
|
} |
226
|
|
|
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.