1 <?php
2 /**
3 * @author Krzysztof Gzocha <krzysztof.gzocha@xsolve.pl>
4 */
5 namespace Team3\PayU\Communication\Process;
6
7 use Symfony\Component\Validator\ConstraintViolationListInterface;
8
9 /**
10 * This exception will be thrown when {@link PayURequestInterface}
11 * requires an object, but this object is invalid.
12 * To get violations please use {@method getViolations}
13 *
14 * Class InvalidRequestDataObjectException
15 * @package Team3\PayU\Communication\Process
16 */
17 class InvalidRequestDataObjectException extends RequestProcessException
18 {
19 /**
20 * @var ConstraintViolationListInterface
21 */
22 private $violations;
23
24 /**
25 * @param ConstraintViolationListInterface $violations
26 * @param string $message
27 */
28 public function __construct(
29 ConstraintViolationListInterface $violations,
30 $message = ""
31 ) {
32 parent::__construct($message);
33 $this->violations = $violations;
34 }
35
36 /**
37 * @return ConstraintViolationListInterface
38 */
39 public function getViolations()
40 {
41 return $this->violations;
42 }
43 }
44