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

PageFixtures   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 13
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 11 1
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