FormFactoryBuilderInterface.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. * A builder for FormFactoryInterface objects.
  13. *
  14. * @author Bernhard Schussek <bschussek@gmail.com>
  15. */
  16. interface FormFactoryBuilderInterface
  17. {
  18. /**
  19. * Sets the factory for creating ResolvedFormTypeInterface instances.
  20. *
  21. * @return $this
  22. */
  23. public function setResolvedTypeFactory(ResolvedFormTypeFactoryInterface $resolvedTypeFactory);
  24. /**
  25. * Adds an extension to be loaded by the factory.
  26. *
  27. * @return $this
  28. */
  29. public function addExtension(FormExtensionInterface $extension);
  30. /**
  31. * Adds a list of extensions to be loaded by the factory.
  32. *
  33. * @param FormExtensionInterface[] $extensions The extensions
  34. *
  35. * @return $this
  36. */
  37. public function addExtensions(array $extensions);
  38. /**
  39. * Adds a form type to the factory.
  40. *
  41. * @return $this
  42. */
  43. public function addType(FormTypeInterface $type);
  44. /**
  45. * Adds a list of form types to the factory.
  46. *
  47. * @param FormTypeInterface[] $types The form types
  48. *
  49. * @return $this
  50. */
  51. public function addTypes(array $types);
  52. /**
  53. * Adds a form type extension to the factory.
  54. *
  55. * @return $this
  56. */
  57. public function addTypeExtension(FormTypeExtensionInterface $typeExtension);
  58. /**
  59. * Adds a list of form type extensions to the factory.
  60. *
  61. * @param FormTypeExtensionInterface[] $typeExtensions The form type extensions
  62. *
  63. * @return $this
  64. */
  65. public function addTypeExtensions(array $typeExtensions);
  66. /**
  67. * Adds a type guesser to the factory.
  68. *
  69. * @return $this
  70. */
  71. public function addTypeGuesser(FormTypeGuesserInterface $typeGuesser);
  72. /**
  73. * Adds a list of type guessers to the factory.
  74. *
  75. * @param FormTypeGuesserInterface[] $typeGuessers The type guessers
  76. *
  77. * @return $this
  78. */
  79. public function addTypeGuessers(array $typeGuessers);
  80. /**
  81. * Builds and returns the factory.
  82. *
  83. * @return FormFactoryInterface The form factory
  84. */
  85. public function getFormFactory();
  86. }