StatusSelector   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 37
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 6 1
A prepareVars() 0 8 1
A getSaveValue() 0 4 1
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