Completed
Push — feature/EVO-7964_fundInfo-exte... ( cf9459...eda009 )
by Bastian
15:13 queued 08:52
created

LoadAppDataExceedSinglePageLimit   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 28
ccs 0
cts 15
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 18 2
1
<?php
2
/**
3
 * /core/app fixtures for mongodb app collection, exceeding one page size.
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
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
14
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
15
 * @link     http://swisscom.ch
16
 */
17
class LoadAppDataExceedSinglePageLimit implements FixtureInterface
18
{
19
    /**
20
     * {@inheritDoc}
21
     *
22
     * @param ObjectManager $manager Object Manager
23
     *
24
     * @return void
25
     */
26
    public function load(ObjectManager $manager)
27
    {
28
        $howManyApps = 15;
29
        $createdCount = 0;
30
31
        while ($createdCount < $howManyApps) {
32
            $app = new App;
33
            $app->setId('app'.$createdCount);
34
            $app->setName('App'.$createdCount);
35
            $app->setShowInMenu(true);
36
            $app->setOrder($createdCount);
37
38
            $manager->persist($app);
39
            $createdCount++;
40
        }
41
42
        $manager->flush();
43
    }
44
}
45