ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SubjectConfirmationValidator.php
Go to the documentation of this file.
1 <?php
2 
4 
10 
12 {
16  protected $constraints;
17 
21  protected $identityProvider;
22 
26  protected $serviceProvider;
27 
28  public function __construct(
31  ) {
32  $this->identityProvider = $identityProvider;
33  $this->serviceProvider = $serviceProvider;
34  }
35 
36  public function addConstraintValidator(
38  ) {
39  if ($constraint instanceof IdentityProviderAware) {
40  $constraint->setIdentityProvider($this->identityProvider);
41  }
42 
43  if ($constraint instanceof ServiceProviderAware) {
44  $constraint->setServiceProvider($this->serviceProvider);
45  }
46 
47  $this->constraints[] = $constraint;
48  }
49 
50  public function validate(SubjectConfirmation $subjectConfirmation)
51  {
52  $result = new Result();
53  foreach ($this->constraints as $validator) {
54  $validator->validate($subjectConfirmation, $result);
55  }
56 
57  return $result;
58  }
59 }
addConstraintValidator(SubjectConfirmationConstraintValidator $constraint)
Basic configuration wrapper.
Basic Configuration Wrapper.
$result
__construct(IdentityProvider $identityProvider, ServiceProvider $serviceProvider)
Simple Result object.
Definition: Result.php:10
Interface for triggering setter injection.
Interface for triggering setter injection.