Completed
Push — master ( 5f70f9...b43387 )
by Yaro
04:12
created

FieldsetMarkup::legend()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Yaro\Jarboe\Table\Fields\Markup;
4
5
use Illuminate\Http\Request;
6
use Yaro\Jarboe\Table\CRUD;
7
use Yaro\Jarboe\Table\Fields\AbstractField;
8
9
class FieldsetMarkup extends AbstractField
10
{
11
    protected $legend = '';
12
    protected $fields = [];
13
14 2
    public function fields(array $fields)
15
    {
16 2
        $this->fields = $fields;
17
18 2
        return $this;
19
    }
20
21 1
    public function legend(string $legend)
22
    {
23 1
        $this->legend = $legend;
24
25 1
        return $this;
26
    }
27
28 1
    public function getLegend(): string
29
    {
30 1
        return $this->legend;
31
    }
32
33 1
    public function getFields(): array
34
    {
35 1
        return $this->fields;
36
    }
37
38
    protected $hidden = [
39
        'list'   => true,
40
        'edit'   => false,
41
        'create' => false,
42
    ];
43
44 1
    public function shouldSkip(Request $request)
45
    {
46 1
        return true;
47
    }
48
49 1
    public function isMarkupRow()
50
    {
51 1
        return true;
52
    }
53
54 1
    public function prepare(CRUD $crud)
55
    {
56 1
        foreach ($this->fields as $field) {
57 1
            $field->prepare($crud);
58
        }
59
    }
60
61 1
    public function getListView($model)
62
    {
63 1
        return '';
64
    }
65
66 1
    public function getEditFormView($model)
67
    {
68 1
        return view('jarboe::crud.fields.markup.fieldset.edit', [
69 1
            'model' => $model,
70 1
            'field' => $this,
71 1
            'rowsLeft' => 12,
72
        ]);
73
    }
74
75 1
    public function getCreateFormView()
76
    {
77 1
        return view('jarboe::crud.fields.markup.fieldset.create', [
78 1
            'field' => $this,
79 1
            'rowsLeft' => 12,
80
        ]);
81
    }
82
}
83