UpdateNoteSearchField::getSource()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 7
nc 3
nop 0
1
<?php
2
3
4
5
class UpdateNoteSearchField extends DropdownField
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
6
{
7
    public function getSource()
8
    {
9
        $members = UpdateNote::get()->column('UpdatedByID');
10
        $memberArray = Member::get()->filter(array("ID" => $members))->map()->toArray();
11
        foreach ($memberArray as $id => $title) {
12
            if (! $title) {
13
                unset($memberArray[$id]);
14
            }
15
        }
16
        return array(''=> _t('UpdateNoteSearchField.ANYONE', '- Anyone -')) + $memberArray;
17
    }
18
}
19