RestfulServerTestAuthor::canView()   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 RestfulServerTestAuthor extends DataObject implements TestOnly
9
{
10
    private static $api_access = true;
0 ignored issues
show
introduced by
The private property $api_access is not used, and could be removed.
Loading history...
11
12
    private static $table_name = 'RestfulServerTestAuthor';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
13
14
    private static $db = array(
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
15
        'FirstName' => 'Text',
16
    );
17
18
    private static $many_many = array(
0 ignored issues
show
introduced by
The private property $many_many is not used, and could be removed.
Loading history...
19
        'RelatedPages' => RestfulServerTestPage::class,
20
        'RelatedAuthors' => RestfulServerTestAuthor::class,
21
        'SortedPages' => [
22
            'through' => AuthorSortedPageRelation::class,
23
            'from' => 'Parent',
24
            'to' => 'SortedPage',
25
        ],
26
    );
27
28
    private static $has_many = array(
0 ignored issues
show
introduced by
The private property $has_many is not used, and could be removed.
Loading history...
29
        'PublishedPages' => RestfulServerTestPage::class,
30
        'Ratings' => RestfulServerTestAuthorRating::class,
31
        'SortedPagesRelation' => AuthorSortedPageRelation::class . '.Parent',
32
    );
33
34
    public function canView($member = null)
35
    {
36
        return true;
37
    }
38
}
39