RelativePath.php 888 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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\Validator\ViolationMapper;
  11. use Symfony\Component\Form\FormInterface;
  12. use Symfony\Component\PropertyAccess\PropertyPath;
  13. /**
  14. * @author Bernhard Schussek <bschussek@gmail.com>
  15. */
  16. class RelativePath extends PropertyPath
  17. {
  18. private $root;
  19. /**
  20. * @param FormInterface $root
  21. * @param string $propertyPath
  22. */
  23. public function __construct(FormInterface $root, $propertyPath)
  24. {
  25. parent::__construct($propertyPath);
  26. $this->root = $root;
  27. }
  28. /**
  29. * @return FormInterface
  30. */
  31. public function getRoot()
  32. {
  33. return $this->root;
  34. }
  35. }