Passed
Push — master ( 0a87d5...5ba6bb )
by Julito
18:12
created

AccessGroupFixtures::setContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
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\Repository\GroupRepository;
10
use Doctrine\Bundle\FixturesBundle\Fixture;
11
use Doctrine\Persistence\ObjectManager;
12
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
13
use Symfony\Component\DependencyInjection\ContainerInterface;
14
15
class AccessGroupFixtures extends Fixture implements ContainerAwareInterface
16
{
17
    private ContainerInterface $container;
18
19
    public function setContainer(ContainerInterface $container = null): void
20
    {
21
        $this->container = $container;
22
    }
23
24
    public function load(ObjectManager $manager): void
25
    {
26
        /** @var GroupRepository $repo */
27
        $repo = $this->container->get(GroupRepository::class);
28
        $repo->createDefaultGroups($this);
29
    }
30
}
31