Completed
Push — FVSv2 ( 306d39...307047 )
by Patrick
01:37
created

VolunteerRole   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __get() 0 14 3
1
<?php
2
class VolunteerRole extends VolunteerObject
3
{
4
    public function __construct($roleid, $dbData = null)
5
    {
6
        parent::__construct($roleid, $dbData, 'roles', 'short_name');
7
    }
8
9
    public function __get($propName)
10
    {
11
        switch($propName)
12
        {
13
            case 'down_time':
14
                if(!isset($this->dbData['down_time']))
15
                {
16
                    return 0;
17
                }
18
                return intval($this->dbData['down_time']);
19
            default:
20
                parent::__get($propName);
21
        }
22
    }
23
}
24