DoctrineOrmExtension.php 811B

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