Completed
Pull Request — master (#288)
by Damian
02:08
created

FolderFormBuilder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFormActions() 0 10 2
1
<?php
2
3
namespace SilverStripe\AssetAdmin\Forms;
4
5
use SilverStripe\Forms\FieldList;
6
7
class FolderFormBuilder extends AssetFormBuilder
8
{
9
10
    /**
11
     * Build basic actions
12
     *
13
     * @return FieldList
14
     */
15
    public function getFormActions()
16
    {
17
        // Add delete action as top level button before extensions are triggered
18
        $this->beforeUpdate('FormActions', function (FieldList $actions) {
19
            if ($deleteAction = $this->getDeleteAction()) {
20
                $actions->push($deleteAction);
21
            }
22
        });
23
        return parent::getFormActions();
24
    }
25
}
26