VolunteerRole   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __get() 0 12 3
A __construct() 0 3 1
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
                return parent::__get($propName);
21
        }
22
    }
23
}
24