Completed
Push — master ( 7edcbc...28e817 )
by greg
02:40
created

MemoryScore::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace PlaygroundGame\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\ORM\Mapping as ORM;
7
use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
8
use Doctrine\ORM\Mapping\PrePersist;
9
use Doctrine\ORM\Mapping\PreUpdate;
10
use Zend\InputFilter\InputFilter;
11
use Zend\InputFilter\InputFilterAwareInterface;
12
use Zend\InputFilter\InputFilterInterface;
13
14
/**
15
 * @ORM\Entity @HasLifecycleCallbacks
16
 * @ORM\Table(name="game_memory_score")
17
 */
18
class MemoryScore implements InputFilterAwareInterface
19
{
20
    protected $inputFilter;
21
22
    /**
23
     * @ORM\Id
24
     * @ORM\Column(type="integer");
25
     * @ORM\GeneratedValue(strategy="AUTO")
26
     */
27
    protected $id;
28
29
    /**
30
     * @ORM\ManyToOne(targetEntity="Entry")
31
     * @ORM\JoinColumn(name="entry_id", referencedColumnName="id", onDelete="CASCADE")
32
     **/
33
    protected $entry;
34
    
35
    /**
36
     * @ORM\Column(type="integer")
37
     **/
38
    protected $attempts;
39
    
40
    /**
41
     * @ORM\Column(type="integer")
42
     **/
43
    protected $mistakes;
44
    
45
    /**
46
     * @ORM\Column(type="integer")
47
     **/
48
    protected $totalCards;
49
    
50
    /**
51
     * duration of the game, in seconds
52
     * @ORM\Column(type="integer")
53
     **/
54
    protected $duration;
55
56
    /**
57
     * @ORM\Column(type="datetime")
58
     */
59
    protected $created_at;
60
61
    /**
62
     * @ORM\Column(type="datetime")
63
     */
64
    protected $updated_at;
65
66
    public function __construct()
67
    {
68
    }
69
70
    /**
71
     * @PrePersist
72
     */
73
    public function createChrono()
74
    {
75
        $this->created_at = new \DateTime("now");
76
        $this->updated_at = new \DateTime("now");
77
    }
78
79
    /**
80
     * @PreUpdate
81
     */
82
    public function updateChrono()
83
    {
84
        $this->updated_at = new \DateTime("now");
85
    }
86
87
    /**
88
     * @return the unknown_type
89
     */
90
    public function getId()
91
    {
92
        return $this->id;
93
    }
94
95
    /**
96
     * @param unknown_type $id
97
     */
98
    public function setId($id)
99
    {
100
        $this->id = $id;
101
102
        return $this;
103
    }
104
105
    /**
106
     * @return PlaygroundGame\Entity\Entry
107
     */
108
    public function getEntry()
109
    {
110
        return $this->entry;
111
    }
112
113
    /**
114
     * @param PlaygroundGame\Entity\Entry $entry
115
     */
116
    public function setEntry($entry)
117
    {
118
        $this->entry = $entry;
119
120
        return $this;
121
    }
122
123
    /**
124
     * @return integer $attempts
125
     */
126
    public function getAttempts()
127
    {
128
        return $this->attempts;
129
    }
130
131
    /**
132
     * @param integer $attempts
133
     */
134
    public function setAttempts($attempts)
135
    {
136
        $this->attempts = $attempts;
137
        
138
        return $this;
139
    }
140
141
    /**
142
     * @return the $mistakes
143
     */
144
    public function getMistakes()
145
    {
146
        return $this->mistakes;
147
    }
148
149
    /**
150
     * @param field_type $mistakes
151
     */
152
    public function setMistakes($mistakes)
153
    {
154
        $this->mistakes = $mistakes;
155
        
156
        return $this;
157
    }
158
159
    /**
160
     * @return integer $totalCards
161
     */
162
    public function getTotalCards()
163
    {
164
        return $this->totalCards;
165
    }
166
167
    /**
168
     * @param integer $totalCards
169
     */
170
    public function setTotalCards($totalCards)
171
    {
172
        $this->totalCards = $totalCards;
173
        
174
        return $this;
175
    }
176
177
    /**
178
     * @return integer $duration
179
     */
180
    public function getDuration()
181
    {
182
        return $this->duration;
183
    }
184
185
    /**
186
     * @param integer $duration
187
     */
188
    public function setDuration($duration)
189
    {
190
        $this->duration = $duration;
191
        
192
        return $this;
193
    }
194
195
    /**
196
     * @return the unknown_type
197
     */
198
    public function getCreatedAt()
199
    {
200
        return $this->created_at;
201
    }
202
203
    /**
204
     * @param unknown_type $created_at
205
     */
206
    public function setCreatedAt($created_at)
207
    {
208
        $this->created_at = $created_at;
209
210
        return $this;
211
    }
212
213
    /**
214
     * @return the unknown_type
215
     */
216
    public function getUpdatedAt()
217
    {
218
        return $this->updated_at;
219
    }
220
221
    /**
222
     * @param unknown_type $updated_at
223
     */
224
    public function setUpdatedAt($updated_at)
225
    {
226
        $this->updated_at = $updated_at;
227
228
        return $this;
229
    }
230
231
    /**
232
     * Convert the object to an array.
233
     *
234
     * @return array
235
     */
236
    public function getArrayCopy()
237
    {
238
        $obj_vars = get_object_vars($this);
239
240
        return $obj_vars;
241
    }
242
243
    /**
244
     * Populate from an array.
245
     *
246
     * @param array $data
247
     */
248
    public function populate($data = array())
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
249
    {
250
    }
251
252
    public function setInputFilter(InputFilterInterface $inputFilter)
253
    {
254
        throw new \Exception("Not used");
255
    }
256
257
    public function getInputFilter()
258
    {
259
        if (!$this->inputFilter) {
260
            $inputFilter = new InputFilter();
261
            $this->inputFilter = $inputFilter;
262
        }
263
264
        return $this->inputFilter;
265
    }
266
}
267