Completed
Push — master ( a9d3b9...e09e3d )
by Kirill
03:27
created

LoadWidgetData   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 30
ccs 0
cts 20
cp 0
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B load() 0 27 1
1
<?php
2
3
namespace AppBundle\DataFixtures\ORM;
4
5
use AppBundle\Entity\Variable;
6
use Doctrine\Common\DataFixtures\FixtureInterface;
7
use Doctrine\Common\Persistence\ObjectManager;
8
use AppBundle\Entity\Widget;
9
10
class LoadWidgetData implements FixtureInterface
11
{
12
    public function load(ObjectManager $manager)
13
    {
14
        $variable = new Variable();
15
16
        $variable->setName('temperature');
17
        $variable->setDescription('test temperature metric');
18
        $variable->setSource('internal');
19
        $variable->setParser('Simple');
20
        $variable->setValue('20');
21
22
        $manager->persist($variable);
23
24
        $widget = new Widget();
25
26
        $widget->setName('temperature');
27
        $widget->setHeight(2);
28
        $widget->setType('value');
29
        $widget->setWidth(2);
30
        $widget->setX(0);
31
        $widget->setY(0);
32
        $widget->setVariable($variable);
33
34
        $manager->persist($widget);
35
36
37
        $manager->flush();
38
    }
39
}
40