Passed
Push — develop ( 3bc85b...45c84f )
by BENARD
07:51
created

Game::getUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProjetNormandie\TwitchBundle\Entity;
6
7
use ApiPlatform\Metadata\ApiProperty;
8
use DateTime;
9
use Doctrine\ORM\Mapping as ORM;
10
use ProjetNormandie\TwitchBundle\Repository\GameRepository;
11
12
#[ORM\Table(name:'pnt_game')]
13
#[ORM\Entity(repositoryClass: GameRepository::class)]
14
class Game
15
{
16
    #[ApiProperty(identifier: true)]
17
    #[ORM\Id, ORM\Column, ORM\GeneratedValue]
18
    protected ?int $id = null;
19
20
    #[ORM\Column(length: 20, unique: true)]
21
    protected string $externalId;
22
23
    #[ORM\Column(length: 255, nullable: false)]
24
    private string $name = '';
25
26
    #[ORM\Column(length: 255, nullable: true)]
27
    private ?string $picture = null;
28
29
    #[ORM\Column(length: 255, nullable: true)]
30
    private ?string $url = null;
31
32
    #[ORM\Column(nullable: false)]
33
    private DateTime $lastStreamAt;
34
35
    public function getId(): ?int
36
    {
37
        return $this->id;
38
    }
39
40
    public function setId(?int $id): void
41
    {
42
        $this->id = $id;
43
    }
44
45
    public function getExternalId(): string
46
    {
47
        return $this->externalId;
48
    }
49
50
    public function setExternalId(string $externalId): void
51
    {
52
        $this->externalId = $externalId;
53
    }
54
55
    public function getName(): string
56
    {
57
        return $this->name;
58
    }
59
60
    public function setName(string $name): void
61
    {
62
        $this->name = $name;
63
    }
64
65
    public function getPicture(): ?string
66
    {
67
        return $this->picture;
68
    }
69
70
    public function setPicture(?string $picture): void
71
    {
72
        $this->picture = $picture;
73
    }
74
75
    public function getUrl(): ?string
76
    {
77
        return $this->url;
78
    }
79
80
    public function setUrl(?string $url): void
81
    {
82
        $this->url = $url;
83
    }
84
85
    public function getLastStreamAt(): DateTime
86
    {
87
        return $this->lastStreamAt;
88
    }
89
90
    public function setLastStreamAt(DateTime $lastStreamAt): void
91
    {
92
        $this->lastStreamAt = $lastStreamAt;
93
    }
94
95
    public function __toString()
96
    {
97
        return sprintf('%s (%d)', $this->getName(), $this->getId());
98
    }
99
}
100