Passed
Push — master ( 435634...9a6e0b )
by Julito
10:38
created

PageFixtures::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 11
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
namespace Chamilo\CoreBundle\DataFixtures;
8
9
use Chamilo\CoreBundle\Entity\PageCategory;
10
use Chamilo\CoreBundle\Entity\User;
11
use Doctrine\Bundle\FixturesBundle\Fixture;
12
use Doctrine\Persistence\ObjectManager;
13
14
class PageFixtures extends Fixture
15
{
16
    public function load(ObjectManager $manager): void
17
    {
18
        /** @var User $admin */
19
        $admin = $this->getReference(AccessUserFixtures::ADMIN_USER_REFERENCE);
20
        $category = (new PageCategory())
21
            ->setTitle('home')
22
            ->setType('grid')
23
            ->setCreator($admin)
24
        ;
25
        $manager->persist($category);
26
        $manager->flush();
27
    }
28
}
29