Symfony\Component\Validator\ConstraintViolation::getPropertyPath PHP Method

getPropertyPath() public method

public getPropertyPath ( )
    public function getPropertyPath()
    {
        return $this->propertyPath;
    }

Usage Example

Beispiel #1
0
 private function getLineNumber(ConstraintViolation $violation)
 {
     if (!preg_match('/lines\\[(\\d+)\\]/', $violation->getPropertyPath(), $matches)) {
         throw new \InvalidArgumentException(sprintf('Cannot get line number of string "%s". Format has to be: line[%line_number%]', $violation->getPropertyPath()));
     }
     return intval($matches[1]);
 }
All Usage Examples Of Symfony\Component\Validator\ConstraintViolation::getPropertyPath