Tenant   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 80
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setId() 0 6 1
A getId() 0 4 1
A setName() 0 6 1
A getName() 0 4 1
A setSubdomain() 0 6 1
A getSubdomain() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
4
namespace Tahoe\Bundle\MultiTenancyBundle\Entity;
5
6
use Symfony\Component\Security\Core\User\UserInterface;
7
use Tahoe\Bundle\MultiTenancyBundle\Model\MultiTenantTenantInterface;
8
9
class Tenant implements MultiTenantTenantInterface
10
{
11
    /**
12
     * @var integer
13
     */
14
    protected $id;
15
    /**
16
     * @var string
17
     */
18
    protected $name;
19
    /**
20
     * @var string
21
     */
22
    protected $subdomain;
23
24
    /**
25
     * @param int $id
26
     *
27
     * @return $this
28
     */
29
    public function setId($id)
30
    {
31
        $this->id = $id;
32
33
        return $this;
34
    }
35
36
    /**
37
     * @return int
38
     */
39
    public function getId()
40
    {
41
        return $this->id;
42
    }
43
44
    /**
45
     * @param string $name
46
     *
47
     * @return $this
48
     */
49
    public function setName($name)
50
    {
51
        $this->name = $name;
52
53
        return $this;
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getName()
60
    {
61
        return $this->name;
62
    }
63
64
    /**
65
     * @param string $subdomain
66
     *
67
     * @return $this
68
     */
69
    public function setSubdomain($subdomain)
70
    {
71
        $this->subdomain = $subdomain;
72
73
        return $this;
74
    }
75
76
    /**
77
     * @return string
78
     */
79
    public function getSubdomain()
80
    {
81
        return $this->subdomain;
82
    }
83
84
    public function __toString()
85
    {
86
        return (string) sprintf('%s (%s)', $this->getName(), $this->getSubdomain());
87
    }
88
}
89