Completed
Push — develop ( 7df659...40d27c )
by
unknown
36:05 queued 27:43
created

JobDescriptionFieldset::allowObjectBinding()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 2
eloc 2
nc 2
nop 1
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 Jobs\Entity\TemplateValuesInterface;
14
use Zend\Form\Fieldset;
15
use Jobs\Form\Hydrator\JobDescriptionHydrator;
16
17
/**
18
 * Defines the formular fields of a job opening
19
 *
20
 * @package Jobs\Form
21
 */
22
class JobDescriptionFieldset extends Fieldset
23
{
24
25
    public function getHydrator()
26
    {
27
        if (!$this->hydrator) {
28
            $hydrator = new JobDescriptionHydrator();
29
            $this->setHydrator($hydrator);
30
        }
31
        return $this->hydrator;
32
    }
33
34
    public function allowObjectBinding($object)
35
    {
36
        return $object instanceof TemplateValuesInterface || parent::allowObjectBinding($object);
37
    }
38
39
    public function init()
40
    {
41
        $this->setAttribute('id', 'description-fieldset');
42
        $this->setLabel('Description');
43
44
45
        $this->add(
46
            array(
47
            'type' => 'Texteditor',
48
            'name' => 'descriptionqualification',
49
            'options' => array(
50
                'label' => /*@translate*/ 'Job qualification'
51
            ),
52
            )
53
        );
54
55
        $this->add(
56
            array(
57
            'type' => 'Texteditor',
58
            'name' => 'descriptionbenefits',
59
            'options' => array(
60
                'label' => /*@translate*/ 'Job benefits'
61
            ),
62
            )
63
        );
64
65
66
        $this->add(
67
            array(
68
            'type' => 'Texteditor',
69
            'name' => 'descriptionrequirements',
70
            'options' => array(
71
                'label' => /*@translate*/ 'Job requirements'
72
            ),
73
            )
74
        );
75
    }
76
}
77