SingleRunningBalance::getBalance()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace JhFlexiTimeTest\Fixture;
4
5
use Doctrine\Common\DataFixtures\AbstractFixture;
6
use Doctrine\Common\Persistence\ObjectManager;
7
use JhFlexiTime\Entity\RunningBalance;
8
use JhUser\Entity\User;
9
10
/**
11
 * Class SingleRunningBalance
12
 * @package JhUserTest\Fixture
13
 * @author Aydin Hassan <[email protected]>
14
 */
15
class SingleRunningBalance extends AbstractFixture
16
{
17
    /**
18
     * @var RunningBalance
19
     */
20
    protected $runningBalance;
21
22
    /**
23
     * {inheritDoc}
24
     */
25
    public function load(ObjectManager $manager)
26
    {
27
        $this->runningBalance = new RunningBalance();
28
29
        $user = new User();
30
        $user->setEmail("[email protected]")
31
             ->setPassword('password');
32
        $this->runningBalance
33
            ->setUser($user)
34
            ->setBalance('10');
35
36
        $manager->persist($user);
37
        $manager->persist($this->runningBalance);
38
        $manager->flush();
39
    }
40
41
    /**
42
     * @return RunningBalance
43
     */
44
    public function getBalance()
45
    {
46
        return $this->runningBalance;
47
    }
48
}
49