Completed
Pull Request — develop (#235)
by ANTHONIUS
08:47
created

SearchFormFieldset::init()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 46
Code Lines 31

Duplication

Lines 46
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 46
loc 46
rs 8.9411
cc 1
eloc 31
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 Core\Form\TextSearchFormFieldset;
13
14
class SearchFormFieldset extends TextSearchFormFieldset
15
{
16
17
    protected $locationEngineType = 'photon';
18
19 View Code Duplication
    public function init()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
    {
21
        $this->addTextElement(
22
            'Search',
23
            /*@translate*/
24
            'Search for Applicant Name'
25
        );
26
27
        $this->add(
28
            array(
29
                'name' => 'l',
30
                'type' => 'Location',
31
                'options' => array(
32
                    'label' => /*@translate*/
33
                        'Location',
34
                    'engine_type' => $this->locationEngineType,
35
                ),
36
            )
37
        );
38
39
        $this->add(
40
            array(
41
                'name' => 'd',
42
                'type' => 'Zend\Form\Element\Select',
43
                'options' => array(
44
                    'label' => /*@translate*/
45
                        'Distance',
46
                    'value_options' => [
47
                        '5' => '5 km',
48
                        '10' => '10 km',
49
                        '20' => '20 km',
50
                        '50' => '50 km',
51
                        '100' => '100 km'
52
                    ],
53
54
                ),
55
                'attributes' => [
56
                    'value' => '10', // default distance
57
                    'data-searchbox' => -1,  // hide the search box
58
                    'data-allowclear' => 'false', // allow to clear a selected value
59
                    'data-placeholder' => /*@translate*/
60
                        'Distance',
61
                ]
62
            )
63
        );
64
    }
65
}