GridFieldFormAction::setExtraAttributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace SilverStripe\Blog\Admin;
4
5
use SilverStripe\Forms\GridField\GridField_FormAction;
6
7
class GridFieldFormAction extends GridField_FormAction
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $extraAttributes = [];
13
14
    /**
15
     * @param array $attributes
16
     */
17
    public function setExtraAttributes(array $attributes)
18
    {
19
        $this->extraAttributes = $attributes;
20
    }
21
22
    /**
23
     * @return array
24
     */
25
    public function getAttributes()
26
    {
27
        $attributes = parent::getAttributes();
28
29
        return array_merge(
30
            $attributes,
31
            $this->extraAttributes
32
        );
33
    }
34
}
35