Completed
Push — master ( 544604...d00f37 )
by Franco
11s
created

ContentReviewLog::canView()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace SilverStripe\ContentReview\Models;
4
5
use SilverStripe\CMS\Model\SiteTree;
6
use SilverStripe\ORM\DataObject;
7
use SilverStripe\Security\Member;
8
use SilverStripe\Security\Security;
9
10
class ContentReviewLog extends DataObject
11
{
12
    /**
13
     * @var array
14
     */
15
    private static $db = [
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $db is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
16
        "Note" => "Text",
17
    ];
18
19
    /**
20
     * @var array
21
     */
22
    private static $has_one = [
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $has_one is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
23
        "Reviewer" => Member::class,
24
        "SiteTree" => SiteTree::class,
25
    ];
26
27
    /**
28
     * @var array
29
     */
30
    private static $summary_fields = [
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $summary_fields is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
31
        "Note"           => ["title" => "Note"],
32
        "Created"        => ["title" => "Reviewed at"],
33
        "Reviewer.Title" => ["title" => "Reviewed by"]
34
    ];
35
36
    /**
37
     * @var string
38
     */
39
    private static $default_sort = "Created DESC";
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $default_sort is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
40
41
    private static $table_name = 'ContentReviewLog';
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $table_name is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
42
43
    /**
44
     * @param mixed $member
45
     *
46
     * @return bool
47
     */
48
    public function canView($member = null)
49
    {
50
        return (bool) Security::getCurrentUser();
51
    }
52
}
53