Completed
Pull Request — master (#12)
by Jason
17:19 queued 04:15
created

ViewableTestObject   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getParentPage() 0 4 1
1
<?php
2
3
namespace Dynamic\ViewableDataObject\Test\TestOnly;
4
5
use Dynamic\ViewableDataObject\Extensions\ViewableDataObject;
6
use SilverStripe\Dev\TestOnly;
7
use SilverStripe\ORM\DataObject;
8
9
class ViewableTestObject extends DataObject implements TestOnly
10
{
11
    /**
12
     * @var array
13
     */
14
    private static $db = [
15
        'Title' => 'Varchar(255)',
16
        'Content' => 'HtmlText',
17
    ];
18
19
    /**
20
     * @var array
21
     */
22
    private static $extensions = [
23
        ViewableDataObject::class,
24
    ];
25
26
    /**
27
     * @return DataObject
28
     */
29
    public function getParentPage()
30
    {
31
        return \Page::get()->first();
32
    }
33
}