RestfulServerTestAuthorRating::canEdit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
namespace SilverStripe\RestfulServer\Tests\Stubs;
4
5
use SilverStripe\Dev\TestOnly;
6
use SilverStripe\ORM\DataObject;
7
8
class RestfulServerTestAuthorRating extends DataObject implements TestOnly
9
{
10
    private static $api_access = array(
0 ignored issues
show
introduced by
The private property $api_access is not used, and could be removed.
Loading history...
11
        'view' => array(
12
            'Rating',
13
            'WriteProtectedField',
14
            'Author'
15
        ),
16
        'edit' => array(
17
            'Rating'
18
        )
19
    );
20
21
    private static $table_name = 'RestfulServerTestAuthorRating';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
22
23
    private static $db = array(
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
24
        'Rating' => 'Int',
25
        'SecretField' => 'Text',
26
        'WriteProtectedField' => 'Text',
27
    );
28
29
    private static $has_one = array(
0 ignored issues
show
introduced by
The private property $has_one is not used, and could be removed.
Loading history...
30
        'Author' => RestfulServerTestAuthor::class,
31
        'SecretRelation' => RestfulServerTestAuthor::class,
32
    );
33
34
    public function canView($member = null)
35
    {
36
        return true;
37
    }
38
39
    public function canEdit($member = null)
40
    {
41
        return true;
42
    }
43
44
    public function canCreate($member = null, $context = array())
45
    {
46
        return true;
47
    }
48
}
49