1 | <?php |
||
20 | final class LoaderContainer implements Container |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * @var \Collections\Map |
||
25 | */ |
||
26 | private $loaders; |
||
27 | |||
28 | /** |
||
29 | * @param FixtureLoader[] $loaders |
||
30 | */ |
||
31 | public function __construct(array $loaders = []) |
||
32 | { |
||
33 | $this->loaders = new Map(); |
||
34 | $this->registerAll($loaders); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Get the loader of fixture |
||
39 | * |
||
40 | * @param string $name |
||
41 | * @return \holyshared\fixture\FixtureLoader |
||
42 | */ |
||
43 | public function get($name) |
||
47 | |||
48 | /** |
||
49 | * @param string $name |
||
50 | * @return bool |
||
51 | */ |
||
52 | public function has($name) |
||
56 | |||
57 | /** |
||
58 | * Register the loader of fixture |
||
59 | * |
||
60 | * @param \holyshared\fixture\FixtureLoader $loader |
||
61 | * @return holyshared\fixture\container\LoaderContainer |
||
62 | */ |
||
63 | public function register(FixtureLoader $loader) |
||
69 | |||
70 | /** |
||
71 | * Register all the loader of fixture |
||
72 | * |
||
73 | * @param \holyshared\fixture\FixtureLoader[] $loaders |
||
74 | * @return holyshared\fixture\container\LoaderContainer |
||
75 | */ |
||
76 | public function registerAll(array $loaders = []) |
||
83 | |||
84 | } |
||
85 |