1 | <?php |
||
22 | class ChainLoader implements LoaderInterface |
||
23 | { |
||
24 | protected $loaders = []; |
||
25 | |||
26 | /** |
||
27 | * Adds a loader instance. |
||
28 | * |
||
29 | * @param LoaderInterface $loader A Loader instance |
||
30 | */ |
||
31 | 106 | public function addLoader(LoaderInterface $loader) |
|
35 | |||
36 | /** |
||
37 | * Loads a Meta class from given datasource. |
||
38 | * |
||
39 | * @param string $type object type |
||
40 | * @param array|null $parameters parameters needed to load required object type |
||
41 | * @param int $responseType response type: single meta (LoaderInterface::SINGLE) or collection of metas (LoaderInterface::COLLECTION) |
||
42 | * |
||
43 | * @return Meta|bool false if meta cannot be loaded, a Meta instance otherwise |
||
44 | */ |
||
45 | 17 | public function load($type, $parameters = [], $responseType = LoaderInterface::SINGLE) |
|
57 | |||
58 | /** |
||
59 | * Checks if Loader supports provided type. |
||
60 | * |
||
61 | * @param string $type |
||
62 | * |
||
63 | * @return bool |
||
64 | */ |
||
65 | 1 | public function isSupported(string $type) : bool |
|
75 | } |
||
76 |