Completed
Push — develop ( 3af89d...cb4d39 )
by
unknown
07:47
created

CompanyNameFieldset::init()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 38
Code Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 38
rs 8.8571
cc 1
eloc 25
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
 * @author    [email protected]
9
 */
10
11
namespace Jobs\Form;
12
13
use Core\Form\HeadscriptProviderInterface;
14
use Core\Form\ViewPartialProviderInterface;
15
use Core\Form\ViewPartialProviderTrait;
16
use Jobs\Entity\JobInterface;
17
use Organizations\Entity\EmployeeInterface;
18
use string;
19
use Zend\Form\Fieldset;
20
21
/**
22
 * Defines the formular fields used in the formular for entering the hiring organization name
23
 *
24
 * @package Jobs\Form
25
 */
26
class CompanyNameFieldset extends Fieldset implements HeadscriptProviderInterface, ViewPartialProviderInterface
27
{
28
    use ViewPartialProviderTrait;
29
30
    private $defaultPartial = 'jobs/form/company-name-fieldset';
0 ignored issues
show
Unused Code introduced by
The property $defaultPartial is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
31
    /**
32
     *
33
     *
34
     * @var array
35
     */
36
    protected $headscripts = [ 'Jobs/js/forms.manager-select.js' ];
37
38
    public function setHeadscripts(array $scripts)
39
    {
40
        $this->headscripts = $scripts;
41
42
        return $this;
43
    }
44
45
    public function getHeadscripts()
46
    {
47
        return $this->headscripts;
48
    }
49
50
51
    public function init()
52
    {
53
        $this->setAttribute('id', 'jobcompanyname-fieldset');
54
        $this->setName('jobCompanyName');
55
56
        $this->add(
57
            [
58
                'type' => 'Jobs/HiringOrganizationSelect',
59
                'property' => true,
60
                'name' => 'companyId',
61
                'options' => [
62
                    'label' => /*@translate*/ 'Companyname',
63
                ],
64
                'attributes' => [
65
                    'data-placeholder' => /*@translate*/ 'Select hiring organization',
66
                    'data-allowclear'  => 'false',
67
                    'data-width' => '100%'
68
                ],
69
            ]
70
        );
71
72
        $this->add([
73
                'type' => 'Jobs/ManagerSelect',
74
                'property' => true,
75
                'name' => 'managers',
76
                'options' => [
77
                    'label' => /*@translate*/ 'Choose Managers',
78
                ],
79
                'attributes' => [
80
                    'data-allowclear'  => true,
81
                    'data-width' => '100%',
82
                    'multiple' => true,
83
                    'class' => 'manager-select',
84
                    'data-organization-element' => 'organization-select',
85
                ],
86
87
            ]);
88
    }
89
90
91
}
92