DataCollectorExtension.php 942 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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\Extension\DataCollector;
  11. use Symfony\Component\Form\AbstractExtension;
  12. /**
  13. * Extension for collecting data of the forms on a page.
  14. *
  15. * @author Robert Schönthal <robert.schoenthal@gmail.com>
  16. * @author Bernhard Schussek <bschussek@gmail.com>
  17. */
  18. class DataCollectorExtension extends AbstractExtension
  19. {
  20. private $dataCollector;
  21. public function __construct(FormDataCollectorInterface $dataCollector)
  22. {
  23. $this->dataCollector = $dataCollector;
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. protected function loadTypeExtensions()
  29. {
  30. return array(
  31. new Type\DataCollectorTypeExtension($this->dataCollector),
  32. );
  33. }
  34. }