Completed
Push — master ( df1f12...4872e5 )
by Lucas
05:42
created

LoadAppData   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 93.75%
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 30
ccs 15
cts 16
cp 0.9375
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 20 1
1
<?php
2
/**
3
 * /core/app fixtures for mongodb app collection.
4
 */
5
6
namespace Graviton\CoreBundle\DataFixtures\MongoDB;
7
8
use Doctrine\Common\DataFixtures\FixtureInterface;
9
use Doctrine\Common\Persistence\ObjectManager;
10
use Graviton\CoreBundle\Document\App;
11
12
/**
13
 * Load App data fixtures into mongodb
14
 *
15
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
16
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
17
 * @link     http://swisscom.ch
18
 */
19
class LoadAppData implements FixtureInterface
20
{
21
    /**
22
     * {@inheritDoc}
23
     *
24
     * @param ObjectManager $manager Object Manager
25
     *
26
     * @return void
27
     */
28 57
    public function load(ObjectManager $manager)
29
    {
30 57
        $tabletApp = new App;
31 57
        $tabletApp->setId('tablet');
32 57
        $tabletApp->setName('Tablet');
33 57
        $tabletApp->setShowInMenu(true);
34 57
        $tabletApp->setOrder(1);
35
36 57
        $manager->persist($tabletApp);
37
38 57
        $adminApp = new App;
39 57
        $adminApp->setId('admin');
40 57
        $adminApp->setName('Administration');
41 57
        $adminApp->setShowInMenu(true);
42 57
        $adminApp->setOrder(2);
43
44 57
        $manager->persist($adminApp);
45
46 57
        $manager->flush();
47 57
    }
48
}
49