TopicEntity::setTitle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Comrade42\PhpBBParser\Entity\SimpleMachines;
4
5
use Comrade42\PhpBBParser\Entity\TopicInterface;
6
7
/**
8
 * Class TopicEntity
9
 * @package Comrade42\PhpBBParser\Entity\SimpleMachines
10
 * @Entity
11
 * @Table(
12
 *     name="topics",
13
 *     uniqueConstraints={
14
 *         @UniqueConstraint(name="last_message", columns={"id_last_msg", "id_board"}),
15
 *         @UniqueConstraint(name="first_message", columns={"id_first_msg", "id_board"}),
16
 *         @UniqueConstraint(name="poll", columns={"id_poll", "id_topic"})
17
 *     },
18
 *     indexes={
19
 *         @Index(name="is_sticky", columns={"is_sticky"}),
20
 *         @Index(name="approved", columns={"approved"}),
21
 *         @Index(name="id_board", columns={"id_board"}),
22
 *         @Index(name="member_started", columns={"id_member_started", "id_board"}),
23
 *         @Index(name="last_message_sticky", columns={"id_board", "is_sticky", "id_last_msg"}),
24
 *         @Index(name="board_news", columns={"id_board", "id_first_msg"})
25
 *     }
26
 * )
27
 */
28
class TopicEntity implements TopicInterface
29
{
30
    /**
31
     * @var integer
32
     *
33
     * @Column(name="id_topic", type="integer", nullable=false)
34
     * @Id
35
     */
36
    private $idTopic;
37
38
    /**
39
     * @var boolean
40
     *
41
     * @Column(name="is_sticky", type="boolean", nullable=false)
42
     */
43
    private $isSticky = false;
44
45
    /**
46
     * @var integer
47
     *
48
     * @Column(name="id_board", type="smallint", nullable=false)
49
     */
50
    private $idBoard = 0;
51
52
    /**
53
     * @var integer
54
     *
55
     * @Column(name="id_first_msg", type="integer", nullable=false)
56
     */
57
    private $idFirstMsg = 0;
58
59
    /**
60
     * @var integer
61
     *
62
     * @Column(name="id_last_msg", type="integer", nullable=false)
63
     */
64
    private $idLastMsg = 0;
65
66
    /**
67
     * @var integer
68
     *
69
     * @Column(name="id_member_started", type="integer", nullable=false)
70
     */
71
    private $idMemberStarted = 0;
72
73
    /**
74
     * @var integer
75
     *
76
     * @Column(name="id_member_updated", type="integer", nullable=false)
77
     */
78
    private $idMemberUpdated = 0;
79
80
    /**
81
     * @var integer
82
     *
83
     * @Column(name="id_poll", type="integer", nullable=false)
84
     */
85
    private $idPoll = 0;
0 ignored issues
show
Unused Code introduced by
The property $idPoll is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
86
87
    /**
88
     * @var integer
89
     *
90
     * @Column(name="id_previous_board", type="smallint", nullable=false)
91
     */
92
    private $idPreviousBoard = 0;
0 ignored issues
show
Unused Code introduced by
The property $idPreviousBoard is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
93
94
    /**
95
     * @var integer
96
     *
97
     * @Column(name="id_previous_topic", type="integer", nullable=false)
98
     */
99
    private $idPreviousTopic = 0;
0 ignored issues
show
Unused Code introduced by
The property $idPreviousTopic is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
100
101
    /**
102
     * @var integer
103
     *
104
     * @Column(name="num_replies", type="integer", nullable=false)
105
     */
106
    private $numReplies = 0;
107
108
    /**
109
     * @var integer
110
     *
111
     * @Column(name="num_views", type="integer", nullable=false)
112
     */
113
    private $numViews = 0;
114
115
    /**
116
     * @var boolean
117
     *
118
     * @Column(name="locked", type="boolean", nullable=false)
119
     */
120
    private $locked = false;
121
122
    /**
123
     * @var integer
124
     *
125
     * @Column(name="unapproved_posts", type="smallint", nullable=false)
126
     */
127
    private $unapprovedPosts = 0;
0 ignored issues
show
Unused Code introduced by
The property $unapprovedPosts is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
128
129
    /**
130
     * @var boolean
131
     *
132
     * @Column(name="approved", type="boolean", nullable=false)
133
     */
134
    private $approved = true;
0 ignored issues
show
Unused Code introduced by
The property $approved is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
135
136
    /**
137
     * @return int
138
     */
139
    public function getId()
140
    {
141
        return $this->idTopic;
142
    }
143
144
    /**
145
     * @param int $id
146
     * @return TopicEntity
147
     */
148
    public function setId($id)
149
    {
150
        $this->idTopic = intval($id);
151
152
        return $this;
153
    }
154
155
    /**
156
     * @param int $id
157
     * @return TopicEntity
158
     */
159
    public function setForumId($id)
160
    {
161
        $this->idBoard = intval($id);
162
163
        return $this;
164
    }
165
166
    /**
167
     * @param int $id
168
     * @return TopicEntity
169
     */
170
    public function setMemberStartedId($id)
171
    {
172
        $this->idMemberStarted = intval($id);
173
174
        return $this;
175
    }
176
177
    /**
178
     * @param int $id
179
     * @return TopicEntity
180
     */
181
    public function setMemberUpdatedId($id)
182
    {
183
        $this->idMemberUpdated = intval($id);
184
185
        return $this;
186
    }
187
188
    /**
189
     * @param int $id
190
     * @return TopicEntity
191
     */
192
    public function setFirstMessageId($id)
193
    {
194
        $this->idFirstMsg = intval($id);
195
196
        return $this;
197
    }
198
199
    /**
200
     * @param int $id
201
     * @return TopicEntity
202
     */
203
    public function setLastMessageId($id)
204
    {
205
        $this->idLastMsg = intval($id);
206
207
        return $this;
208
    }
209
210
    /**
211
     * @param string $title
212
     * @return TopicEntity
213
     */
214
    public function setTitle($title)
215
    {
216
        return $this;
217
    }
218
219
    /**
220
     * @param bool $isSticky
221
     * @return TopicEntity
222
     */
223
    public function setIsSticky($isSticky)
224
    {
225
        $this->isSticky = (bool) $isSticky;
226
227
        return $this;
228
    }
229
230
    /**
231
     * @param bool $isLocked
232
     * @return TopicEntity
233
     */
234
    public function setIsLocked($isLocked)
235
    {
236
        $this->locked = (bool) $isLocked;
237
238
        return $this;
239
    }
240
241
    /**
242
     * @param int $number
243
     * @return TopicEntity
244
     */
245
    public function setRepliesNumber($number)
246
    {
247
        $this->numReplies = intval($number);
248
249
        return $this;
250
    }
251
252
    /**
253
     * @param int $number
254
     * @return TopicEntity
255
     */
256
    public function setViewsNumber($number)
257
    {
258
        $this->numViews = intval($number);
259
260
        return $this;
261
    }
262
263
    /**
264
     * @param int $order
265
     * @return TopicEntity
266
     */
267
    public function setOrder($order)
268
    {
269
        return $this;
270
    }
271
}
272