@@ 21-147 (lines=127) @@ | ||
18 | * @ORM\Table(name="game_memory") |
|
19 | */ |
|
20 | ||
21 | class Memory extends Game implements InputFilterAwareInterface |
|
22 | { |
|
23 | const CLASSTYPE = 'memory'; |
|
24 | ||
25 | /** |
|
26 | * the cards associated with the game |
|
27 | * @ORM\OneToMany(targetEntity="MemoryCard", mappedBy="game") |
|
28 | */ |
|
29 | protected $cards; |
|
30 | ||
31 | /** |
|
32 | * @ORM\Column(name="back_image", type="string", length=255, nullable=true) |
|
33 | */ |
|
34 | protected $backImage; |
|
35 | ||
36 | /** |
|
37 | * @ORM\Column(name="victory_conditions", type="integer", nullable=false) |
|
38 | */ |
|
39 | protected $victoryConditions = 0; |
|
40 | ||
41 | public function __construct() |
|
42 | { |
|
43 | parent::__construct(); |
|
44 | $this->setClassType(self::CLASSTYPE); |
|
45 | $this->cards = new ArrayCollection(); |
|
46 | } |
|
47 | ||
48 | /** |
|
49 | * Gets the the cards associated with the game. |
|
50 | * |
|
51 | * @return mixed |
|
52 | */ |
|
53 | public function getCards() |
|
54 | { |
|
55 | return $this->cards; |
|
56 | } |
|
57 | ||
58 | /** |
|
59 | * Sets the the cards associated with the game. |
|
60 | * |
|
61 | * @param mixed $cards the cards |
|
62 | * |
|
63 | * @return self |
|
64 | */ |
|
65 | protected function setCards($cards) |
|
66 | { |
|
67 | $this->cards = $cards; |
|
68 | ||
69 | return $this; |
|
70 | } |
|
71 | ||
72 | /** |
|
73 | * Add a card to the trading card. |
|
74 | * |
|
75 | * |
|
76 | * @return void |
|
77 | */ |
|
78 | public function addCard($card) |
|
79 | { |
|
80 | $this->cards[] = $card; |
|
81 | } |
|
82 | ||
83 | /** |
|
84 | * |
|
85 | * @return the $backImage |
|
86 | */ |
|
87 | public function getBackImage() |
|
88 | { |
|
89 | return $this->backImage; |
|
90 | } |
|
91 | ||
92 | /** |
|
93 | * |
|
94 | * @param field_type $backImage |
|
95 | */ |
|
96 | public function setBackImage($backImage) |
|
97 | { |
|
98 | $this->backImage = $backImage; |
|
99 | ||
100 | return $this; |
|
101 | } |
|
102 | ||
103 | public function getVictoryConditions() |
|
104 | { |
|
105 | return $this->victoryConditions; |
|
106 | } |
|
107 | ||
108 | /** |
|
109 | */ |
|
110 | public function setVictoryConditions($victoryConditions) |
|
111 | { |
|
112 | $this->victoryConditions = $victoryConditions; |
|
113 | ||
114 | return $this; |
|
115 | } |
|
116 | ||
117 | /** |
|
118 | * Convert the object to an array. |
|
119 | * |
|
120 | * @return array |
|
121 | */ |
|
122 | public function getArrayCopy() |
|
123 | { |
|
124 | $obj_vars = parent::getArrayCopy(); |
|
125 | array_merge($obj_vars, get_object_vars($this)); |
|
126 | ||
127 | return $obj_vars; |
|
128 | } |
|
129 | ||
130 | public function setInputFilter(InputFilterInterface $inputFilter) |
|
131 | { |
|
132 | throw new \Exception("Not used"); |
|
133 | } |
|
134 | ||
135 | public function getInputFilter() |
|
136 | { |
|
137 | if (!$this->inputFilter) { |
|
138 | $inputFilter = new InputFilter(); |
|
139 | ||
140 | $inputFilter = parent::getInputFilter(); |
|
141 | ||
142 | $this->inputFilter = $inputFilter; |
|
143 | } |
|
144 | ||
145 | return $this->inputFilter; |
|
146 | } |
|
147 | } |
|
148 |
@@ 21-163 (lines=143) @@ | ||
18 | * @ORM\Table(name="game_tradingcard") |
|
19 | */ |
|
20 | ||
21 | class TradingCard extends Game implements InputFilterAwareInterface |
|
22 | { |
|
23 | const CLASSTYPE = 'tradingcard'; |
|
24 | ||
25 | /** |
|
26 | * the card models associated with the game |
|
27 | * @ORM\OneToMany(targetEntity="TradingCardModel", mappedBy="game") |
|
28 | */ |
|
29 | protected $models; |
|
30 | ||
31 | /** |
|
32 | * The number of cards in a booster |
|
33 | * @ORM\Column(name="booster_card_number", type="integer", nullable=true) |
|
34 | */ |
|
35 | protected $boosterCardNumber; |
|
36 | ||
37 | /** |
|
38 | * The number of boosters to deliver to user for each entry |
|
39 | * @ORM\Column(name="booster_draw_quantity", type="integer", nullable=true) |
|
40 | */ |
|
41 | protected $boosterDrawQuantity; |
|
42 | ||
43 | public function __construct() |
|
44 | { |
|
45 | parent::__construct(); |
|
46 | $this->setClassType(self::CLASSTYPE); |
|
47 | $this->models = new ArrayCollection(); |
|
48 | } |
|
49 | ||
50 | /** |
|
51 | * Gets the the card models associated with the game. |
|
52 | * |
|
53 | * @return mixed |
|
54 | */ |
|
55 | public function getModels() |
|
56 | { |
|
57 | return $this->models; |
|
58 | } |
|
59 | ||
60 | /** |
|
61 | * Sets the the card models associated with the game. |
|
62 | * |
|
63 | * @param mixed $models the models |
|
64 | * |
|
65 | * @return self |
|
66 | */ |
|
67 | protected function setModels($models) |
|
68 | { |
|
69 | $this->models = $models; |
|
70 | ||
71 | return $this; |
|
72 | } |
|
73 | ||
74 | /** |
|
75 | * Add a model to the trading card. |
|
76 | * |
|
77 | * |
|
78 | * @return void |
|
79 | */ |
|
80 | public function addModel($model) |
|
81 | { |
|
82 | $this->models[] = $model; |
|
83 | } |
|
84 | ||
85 | /** |
|
86 | * Gets the The number of cards in a booster. |
|
87 | * |
|
88 | * @return mixed |
|
89 | */ |
|
90 | public function getBoosterCardNumber() |
|
91 | { |
|
92 | return $this->boosterCardNumber; |
|
93 | } |
|
94 | ||
95 | /** |
|
96 | * Sets the The number of cards in a booster. |
|
97 | * |
|
98 | * @param mixed $boosterCardNumber the booster card number |
|
99 | * |
|
100 | * @return self |
|
101 | */ |
|
102 | public function setBoosterCardNumber($boosterCardNumber) |
|
103 | { |
|
104 | $this->boosterCardNumber = $boosterCardNumber; |
|
105 | ||
106 | return $this; |
|
107 | } |
|
108 | ||
109 | /** |
|
110 | * Gets the The number of boosters to deliver to user. |
|
111 | * |
|
112 | * @return mixed |
|
113 | */ |
|
114 | public function getBoosterDrawQuantity() |
|
115 | { |
|
116 | return $this->boosterDrawQuantity; |
|
117 | } |
|
118 | ||
119 | /** |
|
120 | * Sets the The number of boosters to deliver to user. |
|
121 | * |
|
122 | * @param mixed $boosterDrawQuantity the booster draw quantity |
|
123 | * |
|
124 | * @return self |
|
125 | */ |
|
126 | public function setBoosterDrawQuantity($boosterDrawQuantity) |
|
127 | { |
|
128 | $this->boosterDrawQuantity = $boosterDrawQuantity; |
|
129 | ||
130 | return $this; |
|
131 | } |
|
132 | ||
133 | /** |
|
134 | * Convert the object to an array. |
|
135 | * |
|
136 | * @return array |
|
137 | */ |
|
138 | public function getArrayCopy() |
|
139 | { |
|
140 | $obj_vars = parent::getArrayCopy(); |
|
141 | array_merge($obj_vars, get_object_vars($this)); |
|
142 | ||
143 | return $obj_vars; |
|
144 | } |
|
145 | ||
146 | public function setInputFilter(InputFilterInterface $inputFilter) |
|
147 | { |
|
148 | throw new \Exception("Not used"); |
|
149 | } |
|
150 | ||
151 | public function getInputFilter() |
|
152 | { |
|
153 | if (!$this->inputFilter) { |
|
154 | $inputFilter = new InputFilter(); |
|
155 | ||
156 | $inputFilter = parent::getInputFilter(); |
|
157 | ||
158 | $this->inputFilter = $inputFilter; |
|
159 | } |
|
160 | ||
161 | return $this->inputFilter; |
|
162 | } |
|
163 | } |
|
164 |