Completed
Push — master ( 6c3b36...3a7f48 )
by wen
02:41
created

IvuColumn::toArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 0
1
<?php
2
3
4
namespace Sco\Admin\Column;
5
6
use JsonSerializable;
7
use Illuminate\Contracts\Support\Arrayable;
8
use Illuminate\Contracts\Support\Jsonable;
9
use Sco\Admin\Contracts\Column\Column as ColumnContract;
10
11
class IvuColumn extends Column implements ColumnContract, Arrayable, Jsonable, JsonSerializable
12
{
13
    protected $defaults = [
14
        'fixed' => false,
15
    ];
16
17
    public function toArray()
18
    {
19
        $column = [
20
            'fixed' => $this->getAttribute('fixed')
21
        ];
22
        $render = $this->getAttribute('render');
23
        if ($render) {
24
            $column['render'] = $render;
25
        }
26
27
        return array_merge(parent::toArray(), $column);
28
    }
29
}
30