FormRegistryInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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\Component\Form;
  11. /**
  12. * The central registry of the Form component.
  13. *
  14. * @author Bernhard Schussek <bschussek@gmail.com>
  15. */
  16. interface FormRegistryInterface
  17. {
  18. /**
  19. * Returns a form type by name.
  20. *
  21. * This methods registers the type extensions from the form extensions.
  22. *
  23. * @param string $name The name of the type
  24. *
  25. * @return ResolvedFormTypeInterface The type
  26. *
  27. * @throws Exception\InvalidArgumentException if the type can not be retrieved from any extension
  28. */
  29. public function getType($name);
  30. /**
  31. * Returns whether the given form type is supported.
  32. *
  33. * @param string $name The name of the type
  34. *
  35. * @return bool Whether the type is supported
  36. */
  37. public function hasType($name);
  38. /**
  39. * Returns the guesser responsible for guessing types.
  40. *
  41. * @return FormTypeGuesserInterface|null
  42. */
  43. public function getTypeGuesser();
  44. /**
  45. * Returns the extensions loaded by the framework.
  46. *
  47. * @return FormExtensionInterface[]
  48. */
  49. public function getExtensions();
  50. }