Passed
Push — master ( 03293a...c184cc )
by Jason
02:52
created

StaffDirectory::getLumberjackTitle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Dynamic\Staff\Pages;
4
5
use Page;
6
use SilverStripe\Lumberjack\Model\Lumberjack;
7
use SilverStripe\ORM\DataList;
8
9
/**
10
 * Class StaffDirectory
11
 * @package Dynamic\Staff\Pages
12
 */
13
class StaffDirectory extends Page
14
{
15
    /**
16
     * @var string
17
     */
18
    private static $singular_name = 'Staff Directory';
0 ignored issues
show
introduced by
The private property $singular_name is not used, and could be removed.
Loading history...
19
20
    /**
21
     * @var string
22
     */
23
    private static $plural_name = 'Staff Directories';
0 ignored issues
show
introduced by
The private property $plural_name is not used, and could be removed.
Loading history...
24
25
    /**
26
     * @var string
27
     */
28
    private static $description = 'A list of staff members';
0 ignored issues
show
introduced by
The private property $description is not used, and could be removed.
Loading history...
29
30
    /**
31
     * @var array
32
     */
33
    private static $extensions = [
0 ignored issues
show
introduced by
The private property $extensions is not used, and could be removed.
Loading history...
34
        Lumberjack::class,
35
    ];
36
37
    /**
38
     * @var array
39
     */
40
    private static $allowed_children = array(
0 ignored issues
show
introduced by
The private property $allowed_children is not used, and could be removed.
Loading history...
41
        StaffMember::class,
42
        StaffDirectory::class,
43
    );
44
45
    /**
46
     * @var string
47 3
     */
48
    private static $table_name = 'StaffDirectory';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
49 3
50
    /**
51 3
     * Return staff members
52
     *
53 3
     * @return DataList
54
     */
55
    public function getStaffMembers()
56
    {
57
        $staffMembers = StaffMember::get()->filter('ParentID', $this->ID);
58
59
        $this->extend('updateGetStaffMembers', $staffMembers);
60
61
        return $staffMembers;
62
    }
63
64
    /**
65
     *
66
     */
67
    public function getLumberjackTitle()
68
    {
69
        return 'Staff Members';
70
    }
71
}
72