FormContractorInterface.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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\FieldDescriptionInterface;
  12. use Sonata\AdminBundle\Admin\AdminInterface;
  13. use Sonata\AdminBundle\Model\ModelManagerInterface;
  14. use Symfony\Component\Form\FormBuilder;
  15. use Symfony\Component\Form\FormFactoryInterface;
  16. interface FormContractorInterface
  17. {
  18. /**
  19. * @abstract
  20. *
  21. * @param \Symfony\Component\Form\FormFactoryInterface $formFactory
  22. */
  23. function __construct(FormFactoryInterface $formFactory);
  24. /**
  25. * @abstract
  26. *
  27. * @param \Sonata\AdminBundle\Admin\AdminInterface $admin
  28. * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
  29. *
  30. * @return void
  31. */
  32. function fixFieldDescription(AdminInterface $admin, FieldDescriptionInterface $fieldDescription);
  33. /**
  34. * @abstract
  35. *
  36. * @param string $name
  37. * @param array $options
  38. *
  39. * @return FormBuilder
  40. */
  41. function getFormBuilder($name, array $options = array());
  42. /**
  43. * @abstract
  44. *
  45. * @param string $type
  46. * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
  47. *
  48. * @return array
  49. */
  50. function getDefaultOptions($type, FieldDescriptionInterface $fieldDescription);
  51. }