|
0
|
1 |
<?php |
|
|
2 |
|
|
|
3 |
/* |
|
|
4 |
* This file is part of the Symfony package. |
|
|
5 |
* |
|
|
6 |
* (c) Fabien Potencier <fabien@symfony.com> |
|
|
7 |
* |
|
|
8 |
* For the full copyright and license information, please view the LICENSE |
|
|
9 |
* file that was distributed with this source code. |
|
|
10 |
*/ |
|
|
11 |
|
|
|
12 |
namespace Symfony\Bridge\Doctrine\Form; |
|
|
13 |
|
|
|
14 |
use Symfony\Component\Form\AbstractExtension; |
|
|
15 |
use Symfony\Bridge\Doctrine\RegistryInterface; |
|
|
16 |
|
|
|
17 |
class DoctrineOrmExtension extends AbstractExtension |
|
|
18 |
{ |
|
|
19 |
protected $registry; |
|
|
20 |
|
|
|
21 |
public function __construct(RegistryInterface $registry) |
|
|
22 |
{ |
|
|
23 |
$this->registry = $registry; |
|
|
24 |
} |
|
|
25 |
|
|
|
26 |
protected function loadTypes() |
|
|
27 |
{ |
|
|
28 |
return array( |
|
|
29 |
new Type\EntityType($this->registry), |
|
|
30 |
); |
|
|
31 |
} |
|
|
32 |
|
|
|
33 |
protected function loadTypeGuesser() |
|
|
34 |
{ |
|
|
35 |
return new DoctrineOrmTypeGuesser($this->registry); |
|
|
36 |
} |
|
|
37 |
} |