ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
TransformerChain.php
Go to the documentation of this file.
1 <?php
2 
4 
10 
11 class TransformerChain implements Transformer
12 {
16  private $transformers = array();
17 
22 
27 
28  public function __construct(
31  ) {
32  $this->identityProvider = $identityProvider;
33  $this->serviceProvider = $serviceProvider;
34  }
35 
36  public function addTransformerStep(Transformer $transformer)
37  {
38  if ($transformer instanceof IdentityProviderAware) {
39  $transformer->setIdentityProvider($this->identityProvider);
40  }
41 
42  if ($transformer instanceof ServiceProviderAware) {
43  $transformer->setServiceProvider($this->serviceProvider);
44  }
45 
46  $this->transformers[] = $transformer;
47  }
48 
54  public function transform(Assertion $assertion)
55  {
56  foreach ($this->transformers as $transformer) {
57  $assertion = $transformer->transform($assertion);
58  }
59 
60  return $assertion;
61  }
62 }
__construct(IdentityProvider $identityProvider, ServiceProvider $serviceProvider)
Basic configuration wrapper.
Basic Configuration Wrapper.
Interface for triggering setter injection.
Interface for triggering setter injection.