InlineConstraint.php 935 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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\Validator\Constraints;
  11. use Symfony\Component\Validator\Constraint;
  12. class InlineConstraint extends Constraint
  13. {
  14. protected $service;
  15. protected $method;
  16. public function validatedBy()
  17. {
  18. return 'sonata.admin.validator.inline';
  19. }
  20. /**
  21. * {@inheritDoc}
  22. */
  23. public function getTargets()
  24. {
  25. return self::CLASS_CONSTRAINT;
  26. }
  27. public function getRequiredOptions()
  28. {
  29. return array(
  30. 'service',
  31. 'method'
  32. );
  33. }
  34. public function getMethod()
  35. {
  36. return $this->method;
  37. }
  38. public function getService()
  39. {
  40. return $this->service;
  41. }
  42. }