Completed
Push — master ( e5a757...47ec18 )
by Robbie
14s
created

RestfulServerTestAuthorRating   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 39
rs 10
c 0
b 0
f 0

3 Methods

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