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

ViewableTestObject::getParentPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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
}