Passed
Push — master ( cbe288...130872 )
by Peter
02:31
created

PageCategory::setIdentifier()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Website\Domain\Entities;
6
7
use AbterPhp\Framework\Domain\Entities\IStringerEntity;
8
9
class PageCategory implements IStringerEntity
10
{
11
    /** @var string */
12
    protected $id;
13
14
    /** @var string */
15
    protected $name;
16
17
    /** @var string */
18
    protected $identifier;
19
20
    /**
21
     * PageCategory constructor.
22
     *
23
     * @param string $id
24
     * @param string $name
25
     * @param string $identifier
26
     */
27
    public function __construct(string $id, string $name, string $identifier)
28
    {
29
        $this->id         = $id;
30
        $this->name       = $name;
31
        $this->identifier = $identifier;
32
    }
33
34
    /**
35
     * @return string
36
     */
37
    public function getId()
38
    {
39
        return $this->id;
40
    }
41
42
    /**
43
     * @param string $id
44
     */
45
    public function setId($id)
46
    {
47
        $this->id = $id;
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function getName(): string
54
    {
55
        return $this->name;
56
    }
57
58
    /**
59
     * @param string $name
60
     *
61
     * @return $this
62
     */
63
    public function setName(string $name): PageCategory
64
    {
65
        $this->name = $name;
66
67
        return $this;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getIdentifier(): string
74
    {
75
        return $this->identifier;
76
    }
77
78
    /**
79
     * @param string $identifier
80
     *
81
     * @return $this
82
     */
83
    public function setIdentifier(string $identifier): PageCategory
84
    {
85
        $this->identifier = $identifier;
86
87
        return $this;
88
    }
89
90
    /**
91
     * @return string
92
     */
93
    public function __toString(): string
94
    {
95
        return $this->getIdentifier();
96
    }
97
}
98