Genre::getId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Uxmp\Core\Orm\Model;
6
7
use Doctrine\Common\Collections\ArrayCollection;
8
use Doctrine\Common\Collections\Collection;
9
use Doctrine\DBAL\Types\Types;
10
use Doctrine\ORM\Mapping as ORM;
11
use Uxmp\Core\Orm\Repository\GenreRepository;
12
13
#[ORM\Entity(repositoryClass: GenreRepository::class)]
14
#[ORM\Table(name: 'genre')]
15
class Genre implements GenreInterface
16
{
17
    #[ORM\Column(type: Types::INTEGER)]
18
    #[ORM\Id, ORM\GeneratedValue(strategy: 'AUTO')]
19
    private int $id;
20
21
    #[ORM\Column(type: Types::STRING)]
22
    private string $title = '';
23
24
    /** @var Collection<int, GenreMapInterface> */
25
    #[ORM\OneToMany(mappedBy: 'genre_map', targetEntity: GenreMapInterface::class, cascade: ['ALL'])]
26
    private Collection $mappedGenres;
27
28 2
    public function __construct()
29
    {
30 2
        $this->mappedGenres = new ArrayCollection();
31
    }
32
33
    public function getId(): int
34
    {
35
        return $this->id;
36
    }
37
38 1
    public function getTitle(): string
39
    {
40 1
        return $this->title;
41
    }
42
43 1
    public function setTitle(string $title): GenreInterface
44
    {
45 1
        $this->title = $title;
46 1
        return $this;
47
    }
48
}
49