Preview::getViewPartial()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright https://yawik.org/COPYRIGHT.php
7
 * @license   MIT
8
 * @author    [email protected]
9
 */
10
11
namespace Jobs\Form;
12
13
use Core\Form\Form;
14
use Core\Form\Container;
15
use Core\Entity\Hydrator\EntityHydrator;
16
use Laminas\InputFilter\InputFilterProviderInterface;
17
use Core\Form\propagateAttributeInterface;
18
19
/**
20
 * Defines the form on the 3rd page when entering a job position
21
 *
22
 * @package Jobs\Form
23
 */
24
class Preview extends Form implements propagateAttributeInterface
25
{
26
    public function getHydrator()
27
    {
28
        if (!$this->hydrator) {
29
            $hydrator = new EntityHydrator();
30
            $this->setHydrator($hydrator);
31
        }
32
        return $this->hydrator;
33
    }
34
35
    public function init()
36
    {
37
        $this->setName('jobs-form-preview');
38
        $this->setAttributes(
39
            array(
40
            'id' => 'jobs-form-preview',
41
            //'data-handle-by' => 'native'
42
            )
43
        );
44
45
46
        $this->add(
47
            array(
48
            'type' => 'Jobs/PreviewFieldset',
49
            'name' => 'jobPreview',
50
            'options' => array(
51
                'use_as_base_fieldset' => true,
52
            ),
53
            )
54
        );
55
    }
56
57
    public function setViewPartial($partial)
0 ignored issues
show
Unused Code introduced by
The parameter $partial is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

57
    public function setViewPartial(/** @scrutinizer ignore-unused */ $partial)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
58
    {
59
        return $this;
60
    }
61
62
    public function getViewPartial()
63
    {
64
        return 'form/preview.phtml';
65
    }
66
67
    public function enableAll($enable = true)
68
    {
69
        foreach ($this as $forms) {
70
            if ($forms instanceof propagateAttributeInterface) {
71
                $forms->enableAll($enable);
72
            }
73
        }
74
        return $this;
75
    }
76
}
77