StatusSelector::render()   A
last analyzed

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 namespace Bedard\Shop\FormWidgets;
2
3
use Backend\Classes\FormWidgetBase;
4
use Bedard\Shop\Models\Status;
5
6
/**
7
 * StatusSelector Form Widget.
8
 */
9
class StatusSelector extends FormWidgetBase
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    protected $defaultAlias = 'bedard_shop_status_selector';
15
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function render()
20
    {
21
        $this->prepareVars();
22
23
        return $this->makePartial('statusselector');
24
    }
25
26
    /**
27
     * Prepares the form widget view data.
28
     */
29
    public function prepareVars()
30
    {
31
        $this->vars['name'] = $this->formField->getName();
32
        $this->vars['value'] = $this->getLoadValue();
33
        $this->vars['model'] = $this->model;
34
35
        $this->vars['statuses'] = Status::all();
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function getSaveValue($value)
42
    {
43
        return $value;
44
    }
45
}
46