FormBuilderInterface.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /*
  3. * This file is part of the Sonata package.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  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 Sonata\AdminBundle\Builder;
  11. use Sonata\AdminBundle\Admin\FieldDescription;
  12. use Sonata\AdminBundle\Admin\Admin;
  13. use Symfony\Component\Form\Form;
  14. use Symfony\Component\Form\FormContextInterface;
  15. use Symfony\Component\Validator\ValidatorInterface;
  16. use Symfony\Component\Form\FieldFactory\FieldFactoryInterface;
  17. interface FormBuilderInterface
  18. {
  19. /**
  20. * @abstract
  21. * @param \Symfony\Component\Form\FieldFactory\FieldFactoryInterface $fieldFactory
  22. * @param \Symfony\Component\Form\FormContextInterface $formContext
  23. * @param \Symfony\Component\Validator\ValidatorInterface $validator
  24. */
  25. function __construct(FieldFactoryInterface $fieldFactory, FormContextInterface $formContext, ValidatorInterface $validator);
  26. /**
  27. * @abstract
  28. * @param \Symfony\Component\Form\Form $form
  29. * @param \Sonata\AdminBundle\Admin\FieldDescription $fieldDescription
  30. * @return void
  31. */
  32. function addField(Form $form, FieldDescription $fieldDescription);
  33. /**
  34. * @abstract
  35. * @param \Sonata\AdminBundle\Admin\Admin $admin
  36. * @param \Sonata\AdminBundle\Admin\FieldDescription $fieldDescription
  37. * @param array $options
  38. * @return void
  39. */
  40. function fixFieldDescription(Admin $admin, FieldDescription $fieldDescription, array $options = array());
  41. /**
  42. * @abstract
  43. * @param $name
  44. * @param $object
  45. * @param array $options
  46. * @return void
  47. */
  48. function getBaseForm($name, $object, array $options = array());
  49. }