IntegerField.php 730 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace Symfony\Components\Form;
  3. /*
  4. * This file is part of the symfony package.
  5. * (c) Fabien Potencier <fabien.potencier@symfony-project.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. /**
  11. * A localized field for entering integers.
  12. *
  13. * @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
  14. */
  15. class IntegerField extends NumberField
  16. {
  17. /**
  18. * {@inheritDoc}
  19. */
  20. protected function configure()
  21. {
  22. $this->addOption('precision', 0);
  23. parent::configure();
  24. }
  25. /**
  26. * {@inheritDoc}
  27. */
  28. public function getData()
  29. {
  30. return (int)parent::getData();
  31. }
  32. }