|
14 | 14 | use Doctrine\Common\Persistence\ManagerRegistry;
|
15 | 15 | use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
16 | 16 | use Symfony\Component\Form\AbstractExtension;
|
17 |
| -use Symfony\Component\Form\ChoiceList\Factory\CachingFactoryDecorator; |
18 |
| -use Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface; |
19 |
| -use Symfony\Component\Form\ChoiceList\Factory\DefaultChoiceListFactory; |
20 |
| -use Symfony\Component\Form\ChoiceList\Factory\PropertyAccessDecorator; |
21 |
| -use Symfony\Component\PropertyAccess\PropertyAccess; |
22 |
| -use Symfony\Component\PropertyAccess\PropertyAccessorInterface; |
23 | 17 |
|
24 | 18 | class DoctrineOrmExtension extends AbstractExtension
|
25 | 19 | {
|
26 | 20 | protected $registry;
|
27 | 21 |
|
28 |
| - /** |
29 |
| - * @var PropertyAccessorInterface |
30 |
| - */ |
31 |
| - private $propertyAccessor; |
32 |
| - |
33 |
| - /** |
34 |
| - * @var ChoiceListFactoryInterface |
35 |
| - */ |
36 |
| - private $choiceListFactory; |
37 |
| - |
38 |
| - public function __construct(ManagerRegistry $registry, PropertyAccessorInterface $propertyAccessor = null, ChoiceListFactoryInterface $choiceListFactory = null) |
| 22 | + public function __construct(ManagerRegistry $registry) |
39 | 23 | {
|
40 | 24 | $this->registry = $registry;
|
41 |
| - $this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor(); |
42 |
| - $this->choiceListFactory = $choiceListFactory ?: new CachingFactoryDecorator(new PropertyAccessDecorator(new DefaultChoiceListFactory(), $this->propertyAccessor)); |
43 | 25 | }
|
44 | 26 |
|
45 | 27 | protected function loadTypes()
|
46 | 28 | {
|
47 | 29 | return array(
|
48 |
| - new EntityType($this->registry, $this->propertyAccessor, $this->choiceListFactory), |
| 30 | + new EntityType($this->registry), |
49 | 31 | );
|
50 | 32 | }
|
51 | 33 |
|
|
0 commit comments