PageRenderTime 46ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigBuilderInterface.php

https://gitlab.com/Marwamimo/Crowdrise_Web
PHP | 288 lines | 34 code | 30 blank | 224 comment | 0 complexity | 6f932ab957723041523197be1f4ae582 MD5 | raw file
  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. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  12. use Symfony\Component\PropertyAccess\PropertyPathInterface;
  13. /**
  14. * @author Bernhard Schussek <bschussek@gmail.com>
  15. */
  16. interface FormConfigBuilderInterface extends FormConfigInterface
  17. {
  18. /**
  19. * Adds an event listener to an event on this form.
  20. *
  21. * @param string $eventName The name of the event to listen to.
  22. * @param callable $listener The listener to execute.
  23. * @param int $priority The priority of the listener. Listeners
  24. * with a higher priority are called before
  25. * listeners with a lower priority.
  26. *
  27. * @return self The configuration object.
  28. */
  29. public function addEventListener($eventName, $listener, $priority = 0);
  30. /**
  31. * Adds an event subscriber for events on this form.
  32. *
  33. * @param EventSubscriberInterface $subscriber The subscriber to attach.
  34. *
  35. * @return self The configuration object.
  36. */
  37. public function addEventSubscriber(EventSubscriberInterface $subscriber);
  38. /**
  39. * Appends / prepends a transformer to the view transformer chain.
  40. *
  41. * The transform method of the transformer is used to convert data from the
  42. * normalized to the view format.
  43. * The reverseTransform method of the transformer is used to convert from the
  44. * view to the normalized format.
  45. *
  46. * @param DataTransformerInterface $viewTransformer
  47. * @param bool $forcePrepend if set to true, prepend instead of appending
  48. *
  49. * @return self The configuration object.
  50. */
  51. public function addViewTransformer(DataTransformerInterface $viewTransformer, $forcePrepend = false);
  52. /**
  53. * Clears the view transformers.
  54. *
  55. * @return self The configuration object.
  56. */
  57. public function resetViewTransformers();
  58. /**
  59. * Prepends / appends a transformer to the normalization transformer chain.
  60. *
  61. * The transform method of the transformer is used to convert data from the
  62. * model to the normalized format.
  63. * The reverseTransform method of the transformer is used to convert from the
  64. * normalized to the model format.
  65. *
  66. * @param DataTransformerInterface $modelTransformer
  67. * @param bool $forceAppend if set to true, append instead of prepending
  68. *
  69. * @return self The configuration object.
  70. */
  71. public function addModelTransformer(DataTransformerInterface $modelTransformer, $forceAppend = false);
  72. /**
  73. * Clears the normalization transformers.
  74. *
  75. * @return self The configuration object.
  76. */
  77. public function resetModelTransformers();
  78. /**
  79. * Sets the value for an attribute.
  80. *
  81. * @param string $name The name of the attribute
  82. * @param mixed $value The value of the attribute
  83. *
  84. * @return self The configuration object.
  85. */
  86. public function setAttribute($name, $value);
  87. /**
  88. * Sets the attributes.
  89. *
  90. * @param array $attributes The attributes.
  91. *
  92. * @return self The configuration object.
  93. */
  94. public function setAttributes(array $attributes);
  95. /**
  96. * Sets the data mapper used by the form.
  97. *
  98. * @param DataMapperInterface $dataMapper
  99. *
  100. * @return self The configuration object.
  101. */
  102. public function setDataMapper(DataMapperInterface $dataMapper = null);
  103. /**
  104. * Set whether the form is disabled.
  105. *
  106. * @param bool $disabled Whether the form is disabled
  107. *
  108. * @return self The configuration object.
  109. */
  110. public function setDisabled($disabled);
  111. /**
  112. * Sets the data used for the client data when no value is submitted.
  113. *
  114. * @param mixed $emptyData The empty data.
  115. *
  116. * @return self The configuration object.
  117. */
  118. public function setEmptyData($emptyData);
  119. /**
  120. * Sets whether errors bubble up to the parent.
  121. *
  122. * @param bool $errorBubbling
  123. *
  124. * @return self The configuration object.
  125. */
  126. public function setErrorBubbling($errorBubbling);
  127. /**
  128. * Sets whether this field is required to be filled out when submitted.
  129. *
  130. * @param bool $required
  131. *
  132. * @return self The configuration object.
  133. */
  134. public function setRequired($required);
  135. /**
  136. * Sets the property path that the form should be mapped to.
  137. *
  138. * @param null|string|PropertyPathInterface $propertyPath
  139. * The property path or null if the path should be set
  140. * automatically based on the form's name.
  141. *
  142. * @return self The configuration object.
  143. */
  144. public function setPropertyPath($propertyPath);
  145. /**
  146. * Sets whether the form should be mapped to an element of its
  147. * parent's data.
  148. *
  149. * @param bool $mapped Whether the form should be mapped.
  150. *
  151. * @return self The configuration object.
  152. */
  153. public function setMapped($mapped);
  154. /**
  155. * Sets whether the form's data should be modified by reference.
  156. *
  157. * @param bool $byReference Whether the data should be
  158. * modified by reference.
  159. *
  160. * @return self The configuration object.
  161. */
  162. public function setByReference($byReference);
  163. /**
  164. * Sets whether the form should read and write the data of its parent.
  165. *
  166. * @param bool $inheritData Whether the form should inherit its parent's data.
  167. *
  168. * @return self The configuration object.
  169. */
  170. public function setInheritData($inheritData);
  171. /**
  172. * Sets whether the form should be compound.
  173. *
  174. * @param bool $compound Whether the form should be compound.
  175. *
  176. * @return self The configuration object.
  177. *
  178. * @see FormConfigInterface::getCompound()
  179. */
  180. public function setCompound($compound);
  181. /**
  182. * Set the types.
  183. *
  184. * @param ResolvedFormTypeInterface $type The type of the form.
  185. *
  186. * @return self The configuration object.
  187. */
  188. public function setType(ResolvedFormTypeInterface $type);
  189. /**
  190. * Sets the initial data of the form.
  191. *
  192. * @param mixed $data The data of the form in application format.
  193. *
  194. * @return self The configuration object.
  195. */
  196. public function setData($data);
  197. /**
  198. * Locks the form's data to the data passed in the configuration.
  199. *
  200. * A form with locked data is restricted to the data passed in
  201. * this configuration. The data can only be modified then by
  202. * submitting the form.
  203. *
  204. * @param bool $locked Whether to lock the default data.
  205. *
  206. * @return self The configuration object.
  207. */
  208. public function setDataLocked($locked);
  209. /**
  210. * Sets the form factory used for creating new forms.
  211. *
  212. * @param FormFactoryInterface $formFactory The form factory.
  213. */
  214. public function setFormFactory(FormFactoryInterface $formFactory);
  215. /**
  216. * Sets the target URL of the form.
  217. *
  218. * @param string $action The target URL of the form.
  219. *
  220. * @return self The configuration object.
  221. */
  222. public function setAction($action);
  223. /**
  224. * Sets the HTTP method used by the form.
  225. *
  226. * @param string $method The HTTP method of the form.
  227. *
  228. * @return self The configuration object.
  229. */
  230. public function setMethod($method);
  231. /**
  232. * Sets the request handler used by the form.
  233. *
  234. * @param RequestHandlerInterface $requestHandler
  235. *
  236. * @return self The configuration object.
  237. */
  238. public function setRequestHandler(RequestHandlerInterface $requestHandler);
  239. /**
  240. * Sets whether the form should be initialized automatically.
  241. *
  242. * Should be set to true only for root forms.
  243. *
  244. * @param bool $initialize True to initialize the form automatically,
  245. * false to suppress automatic initialization.
  246. * In the second case, you need to call
  247. * {@link FormInterface::initialize()} manually.
  248. *
  249. * @return self The configuration object.
  250. */
  251. public function setAutoInitialize($initialize);
  252. /**
  253. * Builds and returns the form configuration.
  254. *
  255. * @return FormConfigInterface
  256. */
  257. public function getFormConfig();
  258. }