BookView::getDescription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Infrastructure\Book\Query\Projections;
6
7
use App\Infrastructure\Author\Query\Projections\AuthorView;
8
use App\Infrastructure\Category\Query\Projections\CategoryView;
9
10
class BookView
11
{
12
    /**
13
     * @var string
14
     */
15
    private $id;
16
    /**
17
     * @var string
18
     */
19
    private $name;
20
21
    /**
22
     * @var string
23
     */
24
    private $description;
25
26
    /**
27
     * @var CategoryView
28
     */
29
    private $category;
30
31
    /**
32
     * @var AuthorView
33
     */
34
    private $author;
35
36
    /**
37
     * BookView constructor.
38
     *
39
     * @param string       $id
40
     * @param string       $name
41
     * @param string       $description
42
     * @param CategoryView $category
43
     * @param AuthorView   $author
44
     */
45
    public function __construct(string $id, string $name, string $description, CategoryView $category, AuthorView $author)
46
    {
47
        $this->id = $id;
48
        $this->name = $name;
49
        $this->description = $description;
50
        $this->category = $category;
51
        $this->author = $author;
52
    }
53
54
    public function getId(): string
55
    {
56
        return $this->id;
57
    }
58
59
    public function getName(): string
60
    {
61
        return $this->name;
62
    }
63
64
    public function changeName(string $name)
65
    {
66
        $this->name = $name;
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function getDescription(): string
73
    {
74
        return $this->description;
75
    }
76
77
    /**
78
     * @return CategoryView
79
     */
80
    public function getCategory(): CategoryView
81
    {
82
        return $this->category;
83
    }
84
85
    /**
86
     * @return AuthorView
87
     */
88
    public function getAuthor(): AuthorView
89
    {
90
        return $this->author;
91
    }
92
}
93