ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
Simple Result object.
Definition: Result.php:10
Value Object representing the current destination.
Definition: Destination.php:10