RelativePath.php 803 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. public function __construct(FormInterface $root, string $propertyPath)
  20. {
  21. parent::__construct($propertyPath);
  22. $this->root = $root;
  23. }
  24. /**
  25. * @return FormInterface
  26. */
  27. public function getRoot()
  28. {
  29. return $this->root;
  30. }
  31. }