BrokenExternalPageTrack   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A Page() 0 4 1
1
<?php
2
3
namespace SilverStripe\ExternalLinks\Model;
4
5
use SilverStripe\CMS\Model\SiteTree;
6
use SilverStripe\ExternalLinks\Model\BrokenExternalPageTrackStatus;
7
use SilverStripe\ExternalLinks\Model\BrokenExternalLink;
8
use SilverStripe\Versioned\Versioned;
9
use SilverStripe\ORM\DataObject;
10
11
/**
12
 * Represents a track for a single page
13
 */
14
class BrokenExternalPageTrack extends DataObject
15
{
16
    private static $table_name = 'BrokenExternalPageTrack';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
17
18
    private static $db = array(
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
19
        'Processed' => 'Boolean'
20
    );
21
22
    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...
23
        'Page' => SiteTree::class,
24
        'Status' => BrokenExternalPageTrackStatus::class
25
    );
26
27
    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...
28
        'BrokenLinks' => BrokenExternalLink::class
29
    );
30
31
    /**
32
     * @return SiteTree
33
     */
34
    public function Page()
35
    {
36
        return Versioned::get_by_stage(SiteTree::class, 'Stage')
37
            ->byID($this->PageID);
0 ignored issues
show
Bug Best Practice introduced by
The property PageID does not exist on SilverStripe\ExternalLin...BrokenExternalPageTrack. Since you implemented __get, consider adding a @property annotation.
Loading history...
38
    }
39
}
40