FormContractorInterface.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /*
  3. * This file is part of the Sonata Project 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 Symfony\Component\Form\FormBuilder;
  13. use Symfony\Component\Form\FormFactoryInterface;
  14. /**
  15. * Interface FormContractorInterface.
  16. *
  17. * @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
  18. */
  19. interface FormContractorInterface extends BuilderInterface
  20. {
  21. /**
  22. * @abstract
  23. *
  24. * @param \Symfony\Component\Form\FormFactoryInterface $formFactory
  25. */
  26. public function __construct(FormFactoryInterface $formFactory);
  27. /**
  28. * @abstract
  29. *
  30. * @param string $name
  31. * @param array $options
  32. *
  33. * @return FormBuilder
  34. */
  35. public function getFormBuilder($name, array $options = array());
  36. /**
  37. * @abstract
  38. *
  39. * @param string $type
  40. * @param \Sonata\AdminBundle\Admin\FieldDescriptionInterface $fieldDescription
  41. *
  42. * @return array
  43. */
  44. public function getDefaultOptions($type, FieldDescriptionInterface $fieldDescription);
  45. }