1 | <?php |
||
16 | class MissionGameCondition implements InputFilterAwareInterface |
||
17 | { |
||
18 | |||
19 | const NONE = 0; |
||
20 | const VICTORY = 1; |
||
21 | const DEFEAT = 2; |
||
22 | const GREATER = 3; |
||
23 | const LESS = 4; |
||
24 | /** |
||
25 | * var $conditions |
||
26 | * Tableau des types de conditions du jeu précendant pour passer au suivant. |
||
27 | */ |
||
28 | public static $conditions = array(self::NONE => 'none', // Go to next game |
||
29 | self::VICTORY => 'victory', // A victory is mandatory to go on |
||
30 | self::DEFEAT => 'defeat', // A defeat is mandatory to go on |
||
31 | self::GREATER => 'greater than x points', // x points to go on |
||
32 | self::LESS => 'less than x points' // < x points to go on |
||
33 | ); |
||
34 | protected $inputFilter; |
||
35 | |||
36 | /** |
||
37 | * @ORM\Id |
||
38 | * @ORM\Column(type="integer"); |
||
39 | * @ORM\GeneratedValue(strategy="AUTO") |
||
40 | */ |
||
41 | protected $id; |
||
42 | |||
43 | /** |
||
44 | * @ORM\ManyToOne(targetEntity="MissionGame", inversedBy="conditions") |
||
45 | * |
||
46 | **/ |
||
47 | protected $missionGame; |
||
48 | |||
49 | /** |
||
50 | * @ORM\Column(name="attribute", type="string", nullable=true) |
||
51 | */ |
||
52 | protected $attribute; |
||
53 | |||
54 | /** |
||
55 | * @ORM\Column(name="comparison", type="string", nullable=true) |
||
56 | */ |
||
57 | protected $comparison; |
||
58 | |||
59 | /** |
||
60 | * @ORM\Column(name="value", type="string", nullable=true) |
||
61 | */ |
||
62 | protected $value; |
||
63 | |||
64 | /** |
||
65 | * @ORM\Column(name="created_at", type="datetime", nullable=true) |
||
66 | */ |
||
67 | protected $createdAt; |
||
68 | |||
69 | /** |
||
70 | * @ORM\Column(name="updated_at", type="datetime", nullable=true) |
||
71 | */ |
||
72 | protected $updatedAt; |
||
73 | |||
74 | /** |
||
75 | * Constructor |
||
76 | */ |
||
77 | public function __construct() |
||
80 | |||
81 | /** |
||
82 | * @return the $id |
||
83 | */ |
||
84 | public function getId() |
||
88 | |||
89 | /** |
||
90 | * @param field_type $id |
||
91 | */ |
||
92 | public function setId($id) |
||
98 | |||
99 | /** |
||
100 | * @param $id |
||
101 | * @return MissionGameCondition |
||
102 | */ |
||
103 | public function setMissionGame($missionGame) |
||
109 | |||
110 | /** |
||
111 | * @return mixed |
||
112 | */ |
||
113 | public function getMissionGame() |
||
117 | |||
118 | /** |
||
119 | * @param $id |
||
120 | * @return MissionGameCondition |
||
121 | */ |
||
122 | public function setAttribute($attribute) |
||
128 | |||
129 | /** |
||
130 | * @return mixed |
||
131 | */ |
||
132 | public function getAttribute() |
||
136 | |||
137 | /** |
||
138 | * @param $id |
||
139 | * @return MissionGameCondition |
||
140 | */ |
||
141 | public function setComparison($comparison) |
||
147 | |||
148 | /** |
||
149 | * @return mixed |
||
150 | */ |
||
151 | public function getComparison() |
||
155 | |||
156 | /** |
||
157 | * @param $id |
||
158 | * @return MissionGameCondition |
||
159 | */ |
||
160 | public function setValue($value) |
||
166 | |||
167 | /** |
||
168 | * @return mixed |
||
169 | */ |
||
170 | public function getValue() |
||
174 | |||
175 | /** @PrePersist */ |
||
176 | public function createChrono() |
||
181 | |||
182 | /** @PreUpdate */ |
||
183 | public function updateChrono() |
||
187 | |||
188 | public function setInputFilter(InputFilterInterface $inputFilter) |
||
192 | |||
193 | public function getInputFilter() |
||
202 | } |
||
203 |