EntityMapBuilderFactory::createService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
/**
3
 * @link    https://github.com/nnx-framework/doctrine
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\Doctrine\Utils;
7
8
use Zend\ServiceManager\FactoryInterface;
9
use Zend\ServiceManager\ServiceLocatorInterface;
10
use Nnx\Doctrine\ObjectManager\DoctrineObjectManagerInterface;
11
use Nnx\ModuleOptions\ModuleOptionsPluginManagerInterface;
12
use Nnx\Doctrine\EntityManager\EntityManagerInterface;
13
14
15
/**
16
 * Class EntityMapBuilderFactory
17
 *
18
 * @package Nnx\Doctrine\Utils
19
 */
20
class EntityMapBuilderFactory implements FactoryInterface
21
{
22
    /**
23
     * @param ServiceLocatorInterface $serviceLocator
24
     *
25
     * @return EntityMapBuilder
26
     *
27
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
28
     */
29
    public function createService(ServiceLocatorInterface $serviceLocator)
30
    {
31
        /** @var DoctrineObjectManagerInterface $doctrineObjectManager */
32
        $doctrineObjectManager = $serviceLocator->get(DoctrineObjectManagerInterface::class);
33
34
        /** @var ModuleOptionsPluginManagerInterface $moduleOptionsPluginManager */
35
        $moduleOptionsPluginManager = $serviceLocator->get(ModuleOptionsPluginManagerInterface::class);
36
37
        /** @var EntityManagerInterface $entityManager */
38
        $entityManager = $serviceLocator->get(EntityManagerInterface::class);
39
40
        return new EntityMapBuilder($doctrineObjectManager, $moduleOptionsPluginManager, $entityManager);
41
    }
42
}
43