Completed
Push — master ( d14e00...ecbd77 )
by Ingo
21s
created

InternalLinkModalExtension::getOwner()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace SilverStripe\CMS\Forms;
4
5
use SilverStripe\Admin\ModalController;
6
use SilverStripe\Core\Extension;
7
use SilverStripe\Forms\Form;
8
9
/**
10
 * Decorates ModalController with insert internal link
11
 * @see ModalController
12
 */
13
class InternalLinkModalExtension extends Extension
14
{
15
    private static $allowed_actions = array(
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...
16
        'editorInternalLink',
17
    );
18
19
    /**
20
     * @return ModalController
21
     */
22
    public function getOwner()
23
    {
24
        /** @var ModalController $owner */
25
        $owner = $this->owner;
26
        return $owner;
27
    }
28
29
30
    /**
31
     * Form for inserting internal link pages
32
     *
33
     * @return Form
34
     */
35
    public function editorInternalLink()
36
    {
37
        /** @var InternalLinkFormFactory $factory */
38
        $factory = InternalLinkFormFactory::singleton();
39
        return $factory->getForm($this->getOwner(), "editorInternalLink");
40
    }
41
}
42