Game   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A setId() 0 3 1
A setFromArray() 0 4 2
A getId() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VideoGamesRecords\DwhBundle\Entity;
6
7
use Doctrine\ORM\Mapping as ORM;
8
use VideoGamesRecords\DwhBundle\Repository\GameRepository;
9
use VideoGamesRecords\CoreBundle\Traits as VgrCoreTraits;
10
use VideoGamesRecords\DwhBundle\Traits\Entity\DateTrait;
11
use VideoGamesRecords\DwhBundle\Traits\Entity\NbPostDay;
12
13
#[ORM\Table(name:'dwh_game')]
14
#[ORM\Entity(repositoryClass: GameRepository::class)]
15
class Game
16
{
17
    use DateTrait;
18
    use NbPostDay;
19
    use VgrCoreTraits\Entity\NbPostTrait;
20
21
    #[ORM\Id, ORM\Column]
22
    private ?int $id;
23
24
    public function __toString()
25
    {
26
        return sprintf('%s [%s]', $this->id, $this->id);
27
    }
28
29
    public function setId(int $id): void
30
    {
31
        $this->id = $id;
32
    }
33
34
    public function getId(): ?int
35
    {
36
        return $this->id;
37
    }
38
39
    public function setFromArray(array $row): void
40
    {
41
        foreach ($row as $key => $value) {
42
            $this->$key = $value;
43
        }
44
    }
45
}
46