Completed
Push — master ( 0f478c...b73fd3 )
by Kamil
14:27 queued 08:29
created

Channel::setType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Sylius\Component\Channel\Model;
15
16
use Sylius\Component\Resource\Model\TimestampableTrait;
17
use Sylius\Component\Resource\Model\ToggleableTrait;
18
19
class Channel implements ChannelInterface
20
{
21
    use TimestampableTrait, ToggleableTrait;
22
23
    /** @var mixed|null */
24
    protected $id;
25
26
    /** @var string|null */
27
    protected $code;
28
29
    /** @var string|null */
30
    protected $name;
31
32
    /** @var string|null */
33
    protected $description;
34
35
    /** @var string|null */
36
    protected $hostname;
37
38
    /** @var string|null */
39
    protected $color;
40
41
    public function __construct()
42
    {
43
        $this->createdAt = new \DateTime();
44
    }
45
46
    public function __toString(): string
47
    {
48
        return (string) $this->name;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function getId()
55
    {
56
        return $this->id;
57
    }
58
59
    /**
60
     * {@inheritdoc}
61
     */
62
    public function getCode(): ?string
63
    {
64
        return $this->code;
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70
    public function setCode(?string $code): void
71
    {
72
        $this->code = $code;
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function getName(): ?string
79
    {
80
        return $this->name;
81
    }
82
83
    /**
84
     * {@inheritdoc}
85
     */
86
    public function setName(?string $name): void
87
    {
88
        $this->name = $name;
89
    }
90
91
    /**
92
     * {@inheritdoc}
93
     */
94
    public function getDescription(): ?string
95
    {
96
        return $this->description;
97
    }
98
99
    /**
100
     * {@inheritdoc}
101
     */
102
    public function setDescription(?string $description): void
103
    {
104
        $this->description = $description;
105
    }
106
107
    /**
108
     * {@inheritdoc}
109
     */
110
    public function getHostname(): ?string
111
    {
112
        return $this->hostname;
113
    }
114
115
    /**
116
     * {@inheritdoc}
117
     */
118
    public function setHostname(?string $hostname): void
119
    {
120
        $this->hostname = $hostname;
121
    }
122
123
    /**
124
     * {@inheritdoc}
125
     */
126
    public function getColor(): ?string
127
    {
128
        return $this->color;
129
    }
130
131
    /**
132
     * {@inheritdoc}
133
     */
134
    public function setColor(?string $color): void
135
    {
136
        $this->color = $color;
137
    }
138
}
139