VolunteerRole::__get()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 7
c 1
b 0
f 0
nc 3
nop 1
dl 0
loc 12
rs 10
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