DoctrineMongoDBExtension::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Doctrine MongoDBBundle
5
 *
6
 * The code was originally distributed inside the Symfony framework.
7
 *
8
 * (c) Fabien Potencier <[email protected]>
9
 * (c) Doctrine Project
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
namespace Saxulum\DoctrineMongodbOdmManagerRegistry\Form;
16
17
use Doctrine\Common\Persistence\ManagerRegistry;
18
use Symfony\Component\Form\AbstractExtension;
19
20
/**
21
 * Form extension.
22
 *
23
 * @author Kris Wallsmith <[email protected]>
24
 * @author Thibault Duplessis <[email protected]>
25
 */
26
class DoctrineMongoDBExtension extends AbstractExtension
27
{
28
    protected $registry = null;
29
30
    public function __construct(ManagerRegistry $registry)
31
    {
32
        $this->registry = $registry;
33
    }
34
35
    protected function loadTypes()
36
    {
37
        return array(
38
            new Type\DocumentType($this->registry),
39
        );
40
    }
41
42
    protected function loadTypeGuesser()
43
    {
44
        return new DoctrineMongoDBTypeGuesser($this->registry);
45
    }
46
}
47