Passed
Push — master ( 5a582b...461cd7 )
by Thomas
02:36
created

Test_EncryptionKey   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 8
c 1
b 0
f 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getForMember() 0 4 1
1
<?php
2
3
namespace LeKoala\Encrypt\Test;
4
5
use SilverStripe\Assets\File;
6
use SilverStripe\Dev\TestOnly;
7
use SilverStripe\ORM\DataObject;
8
9
/**
10
 * @property string $EncryptionKey
11
 * @property int $MemberID
12
 */
13
class Test_EncryptionKey extends DataObject implements TestOnly
14
{
15
    private static $table_name = 'EncryptionKey';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
16
17
    private static $db = [
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
18
        "EncryptionKey" => 'Varchar',
19
    ];
20
21
    private static $has_one = [
0 ignored issues
show
introduced by
The private property $has_one is not used, and could be removed.
Loading history...
22
        "Member" => File::class,
23
    ];
24
25
    public static function getForMember($ID)
26
    {
27
        $rec = self::get()->filter('MemberID', $ID)->first();
28
        return $rec->EncryptionKey ?? null;
29
    }
30
}
31