Completed
Push — develop ( f65419...2fe783 )
by
unknown
06:34
created

BaseFieldsetFactory::createFormInstance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 3
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @license MIT
7
 * @copyright  2013 - 2016 Cross Solution <http://cross-solution.de>
8
 */
9
  
10
/** */
11
namespace Jobs\Factory\Form;
12
13
use Core\Factory\Form\AbstractCustomizableFieldsetFactory;
14
use Interop\Container\ContainerInterface;
15
use Jobs\Form\BaseFieldset;
16
17
18
/**
19
 * Factory for the BaseFieldset (Job Title and Location)
20
 *
21
 * @author Carsten Bleek <[email protected]>
22
 */
23
class BaseFieldsetFactory extends AbstractCustomizableFieldsetFactory
24
{
25
26
    const OPTIONS_NAME = 'Jobs/BaseFieldsetOptions';
27
28
    protected function createFormInstance(ContainerInterface $container, $name, array $options = null) {
29
        /* @var \Geo\Options\ModuleOptions $options */
30
        $options = $container->get('Geo/Options');
31
32
        $fs = new BaseFieldset(
33
            [
34
                'location_engine_type' => $options->getPlugin(),
35
            ]
36
        );
37
38
        $fs->setLocationEngineType($options->getPlugin());
39
40
        return $fs;
41
    }
42
}
43