CategoryEntity   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 4
c 3
b 0
f 0
lcom 1
cbo 0
dl 0
loc 71
ccs 0
cts 19
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A setId() 0 6 1
A getTitle() 0 4 1
A fill() 0 7 1
1
<?php
2
3
namespace Comrade42\PhpBBParser\Entity\SimpleMachines;
4
5
use Comrade42\PhpBBParser\Entity\CategoryInterface;
6
7
/**
8
 * Class CategoryEntity
9
 * @package Comrade42\PhpBBParser\Entity\SimpleMachines
10
 * @Entity
11
 * @Table(name="categories")
12
 */
13
class CategoryEntity implements CategoryInterface
14
{
15
    /**
16
     * @var integer
17
     *
18
     * @Column(name="id_cat", type="smallint", nullable=false)
19
     * @Id
20
     */
21
    public $idCat;
22
23
    /**
24
     * @var integer
25
     *
26
     * @Column(name="cat_order", type="smallint", nullable=false)
27
     */
28
    public $catOrder = 0;
29
30
    /**
31
     * @var string
32
     *
33
     * @Column(name="name", type="string", length=255, nullable=false)
34
     */
35
    public $name = '';
36
37
    /**
38
     * @var boolean
39
     *
40
     * @Column(name="can_collapse", type="boolean", nullable=false)
41
     */
42
    public $canCollapse = 1;
43
44
    /**
45
     * @return int
46
     */
47
    public function getId()
48
    {
49
        return $this->idCat;
50
    }
51
52
    /**
53
     * @param int $id
54
     * @return CategoryEntity
55
     */
56
    public function setId($id)
57
    {
58
        $this->idCat = intval($id);
59
60
        return $this;
61
    }
62
63
    /**
64
     * @return string
65
     */
66
    public function getTitle()
67
    {
68
        return $this->name;
69
    }
70
71
    /**
72
     * @param string $name
73
     * @param int $order
74
     * @return $this
75
     */
76
    public function fill($name, $order)
77
    {
78
        $this->name     = strval($name);
79
        $this->catOrder = intval($order);
80
81
        return $this;
82
    }
83
}
84