Completed
Push — develop ( d888c9...6e2421 )
by
unknown
09:16
created

SearchForm::getViewPartial()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
7
 * @license       MIT
8
 */
9
10
namespace Cv\Form;
11
12
use Cv\Entity\Location;
13
14
class SearchForm extends \Core\Form\SearchForm
15
{
16
    public function init()
17
    {
18
        $this->setName('cv-list-filter');
19
        $this->setAttributes([
20
            'id' => 'cv-list-filter',
21
            //'data-handle-by' => 'native',
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
22
        ]);
23
24
        $this->setOption('text_name', 'search');
25
        $this->setOption('text_placeholder', /*@translate*/ 'Search for resumes');
26
        $this->setOption('text_span', 5);
27
28
        parent::init();
29
30
        $this->setButtonElement('d');
31
    }
32
33
    protected function addElements()
34
    {
35
36
        $this->add(
37
             [
38
                 'name' => 'l',
39
                 'type' => 'LocationSelect',
40
                 'options' => [
41
                     'label' => /*@translate*/ 'Location',
42
                     'span' => 3,
43
                     'location_entity' => Location::class,
44
                 ],
45
                 'attributes' => [
46
                     'data-width' => '100%',
47
                 ],
48
             ]
49
        );
50
51
        $this->add(
52
             [
53
                 'name' => 'd',
54
                 'type' => 'Zend\Form\Element\Select',
55
                 'options' => [
56
                     'label' => /*@translate*/ 'Distance',
57
                     'value_options' => [
58
                         '5' => '5 km',
59
                         '10' => '10 km',
60
                         '20' => '20 km',
61
                         '50' => '50 km',
62
                         '100' => '100 km'
63
                     ],
64
                     'span' => 4,
65
66
                 ],
67
                 'attributes' => [
68
                     'value' => '10', // default distance
69
                     'data-searchbox' => -1,  // hide the search box
70
                     'data-allowclear' => 'false', // allow to clear a selected value
71
                     'data-placeholder' => /*@translate*/ 'Distance',
72
                     'data-width' => '100%',
73
                 ]
74
             ]
75
        );
76
    }
77
}