Completed
Push — master ( 90ccc1...22512f )
by Kamil
35:43
created

Theme::setDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
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
namespace Sylius\Bundle\ThemeBundle\Model;
13
14
/**
15
 * @author Kamil Kokot <[email protected]>
16
 */
17
class Theme implements ThemeInterface
18
{
19
    /**
20
     * @var string
21
     */
22
    protected $name;
23
24
    /**
25
     * @var string
26
     */
27
    protected $path;
28
29
    /**
30
     * @var array
31
     */
32
    protected $authors = [];
33
34
    /**
35
     * @var string
36
     */
37
    protected $title;
38
39
    /**
40
     * @var string
41
     */
42
    protected $description;
43
44
    /**
45
     * @var array
46
     */
47
    protected $parentsNames = [];
48
49
    /**
50
     * @var string
51
     */
52
    protected $code;
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function getId()
58
    {
59
        return $this->getName();
60
    }
61
62
    /**
63
     * {@inheritdoc}
64
     */
65
    public function getName()
66
    {
67
        return $this->name;
68
    }
69
70
    /**
71
     * {@inheritdoc}
72
     */
73
    public function setName($name)
74
    {
75
        $this->name = $name;
76
        $this->code = substr(md5($name), 0, 8);
77
    }
78
79
    /**
80
     * {@inheritdoc}
81
     */
82
    public function getPath()
83
    {
84
        return $this->path;
85
    }
86
87
    /**
88
     * {@inheritdoc}
89
     */
90
    public function setPath($path)
91
    {
92
        $this->path = $path;
93
    }
94
95
    /**
96
     * {@inheritdoc}
97
     */
98
    public function getAuthors()
99
    {
100
        return $this->authors;
101
    }
102
103
    /**
104
     * {@inheritdoc}
105
     */
106
    public function setAuthors(array $authors)
107
    {
108
        $this->authors = $authors;
109
    }
110
111
    /**
112
     * {@inheritdoc}
113
     */
114
    public function getTitle()
115
    {
116
        return $this->title;
117
    }
118
119
    /**
120
     * {@inheritdoc}
121
     */
122
    public function setTitle($title)
123
    {
124
        $this->title = $title;
125
    }
126
127
    /**
128
     * {@inheritdoc}
129
     */
130
    public function getDescription()
131
    {
132
        return $this->description;
133
    }
134
135
    /**
136
     * {@inheritdoc}
137
     */
138
    public function setDescription($description)
139
    {
140
        $this->description = $description;
141
    }
142
143
    /**
144
     * {@inheritdoc}
145
     */
146
    public function getParentsNames()
147
    {
148
        return $this->parentsNames;
149
    }
150
151
    /**
152
     * {@inheritdoc}
153
     */
154
    public function setParentsNames(array $parentsNames)
155
    {
156
        $this->parentsNames = $parentsNames;
157
    }
158
159
    /**
160
     * {@inheritdoc}
161
     */
162
    public function getCode()
163
    {
164
        return $this->code;
165
    }
166
}
167