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