Passed
Branch develop (6d6783)
by BENARD
03:42
created

Game::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace VideoGamesRecords\DwhBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * Game
9
 *
10
 * @ORM\Table(name="dwh_game")
11
 * @ORM\Entity(repositoryClass="VideoGamesRecords\DwhBundle\Repository\GameRepository")
12
 */
13
class Game
14
{
15
    /**
16
     * @var integer
17
     *
18
     * @ORM\Column(name="id", type="integer")
19
     * @ORM\Id
20
     */
21
    private $id;
22
23
    /**
24
     * @var string
25
     * @ORM\Column(name="date", type="string", length=10, nullable=false)
26
     * @ORM\Id
27
     */
28
    private $date;
29
30
    /**
31
     * @var integer
32
     *
33
     * @ORM\Column(name="nbPost", type="integer", nullable=false, options={"default":0})
34
     */
35
    private $nbPost = 0;
36
37
    /**
38
     * @var integer
39
     *
40
     * @ORM\Column(name="nbPostDay", type="integer", nullable=false)
41
     */
42
    private $nbPostDay = 0;
43
44
    /**
45
     * @return string
46
     */
47
    public function __toString()
48
    {
49
        return sprintf('%s [%s]', $this->id, $this->id);
50
    }
51
52
    /**
53
     * Set id
54
     * @param integer $id
55
     * @return Game
56
     */
57
    public function setId(int $id)
58
    {
59
        $this->id = $id;
60
        return $this;
61
    }
62
63
    /**
64
     * Get id
65
     *
66
     * @return integer
67
     */
68
    public function getId()
69
    {
70
        return $this->id;
71
    }
72
73
    /**
74
     * Set date
75
     * @param string $date
76
     * @return Game
77
     */
78
    public function setDate(string $date)
79
    {
80
        $this->date = $date;
81
82
        return $this;
83
    }
84
85
    /**
86
     * Get date
87
     * @return string
88
     */
89
    public function getDate()
90
    {
91
        return $this->date;
92
    }
93
94
    /**
95
     * Set nbPost
96
     * @param integer $nbPost
97
     * @return Game
98
     */
99
    public function setNbPost(int $nbPost)
100
    {
101
        $this->nbPost = $nbPost;
102
103
        return $this;
104
    }
105
106
    /**
107
     * Get nbPost
108
     *
109
     * @return integer
110
     */
111
    public function getNbPost()
112
    {
113
        return $this->nbPost;
114
    }
115
116
    /**
117
     * Set nbPostDay
118
     * @param integer $nbPostDay
119
     * @return Game
120
     */
121
    public function setNbPostDay(int $nbPostDay)
122
    {
123
        $this->nbPostDay = $nbPostDay;
124
125
        return $this;
126
    }
127
128
    /**
129
     * Get nbPostDay
130
     *
131
     * @return integer
132
     */
133
    public function getNbPostDay()
134
    {
135
        return $this->nbPostDay;
136
    }
137
138
    /**
139
     * @param array $row
140
     */
141
    public function setFromArray(array $row)
142
    {
143
        foreach ($row as $key => $value) {
144
            $this->$key = $value;
145
        }
146
    }
147
}
148