1 | <?php |
||
24 | final class SourceCollection implements SourceInterface, \IteratorAggregate |
||
25 | { |
||
26 | /** |
||
27 | * @var SourceInterface[] |
||
28 | */ |
||
29 | private $sources; |
||
30 | |||
31 | /** |
||
32 | * Constructor. |
||
33 | * |
||
34 | * @param SourceInterface[] $sources Initial sources to add. |
||
35 | */ |
||
36 | 4 | public function __construct(array $sources = array()) |
|
44 | |||
45 | /** |
||
46 | * Add source to collection. |
||
47 | * |
||
48 | * @param SourceInterface $source Source to add. |
||
49 | * @return SourceCollection $this Fluent interface. |
||
50 | */ |
||
51 | 4 | public function add(SourceInterface $source) |
|
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | 4 | public function fetch() |
|
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | */ |
||
76 | public function getIterator() |
||
80 | } |
||
81 |