forked from symfony/symfony
/
EntityType.php
39 lines (34 loc) · 905 Bytes
/
EntityType.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Doctrine\Form\Type;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader;
class EntityType extends DoctrineType
{
/**
* Return the default loader object.
*
* @param ObjectManager $manager
* @param array $options
* @return ORMQueryBuilderLoader
*/
protected function getLoader(ObjectManager $manager, array $options)
{
return new ORMQueryBuilderLoader(
$options['query_builder'],
$manager,
$options['class']
);
}
public function getName()
{
return 'entity';
}
}