ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SubjectConfirmationRecipientMatches.php
Go to the documentation of this file.
1<?php
2
4
9
12{
16 private $destination;
17
19 {
20 $this->destination = $destination;
21 }
22
23 public function validate(
24 SubjectConfirmation $subjectConfirmation,
26 ) {
27 $recipient = $subjectConfirmation->SubjectConfirmationData->Recipient;
28 if ($recipient && !$this->destination->equals(new Destination($recipient))) {
29 $result->addError(sprintf(
30 'Recipient in SubjectConfirmationData ("%s") does not match the current destination ("%s")',
31 $recipient,
32 $this->destination
33 ));
34 }
35 }
36}
$result
An exception for terminatinating execution or to throw for unit testing.
Simple Result object.
Definition: Result.php:11
Value Object representing the current destination.
Definition: Destination.php:11