1 | <?php |
||
22 | class ArticleLoader implements LoaderInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $rootDir; |
||
28 | |||
29 | /** |
||
30 | * @var MetaFactory |
||
31 | */ |
||
32 | protected $metaFactory; |
||
33 | |||
34 | /** |
||
35 | * @param string $rootDir path to application root directory |
||
36 | * @param MetaFactory $metaFactory |
||
37 | */ |
||
38 | public function __construct($rootDir, MetaFactory $metaFactory) |
||
43 | |||
44 | /** |
||
45 | * Load meta object by provided type and parameters. |
||
46 | * |
||
47 | * @MetaLoaderDoc( |
||
48 | * description="Article Meta Loader provide simple way to test Loader, it will be removed when real loaders will be merged.", |
||
49 | * parameters={} |
||
50 | * ) |
||
51 | * |
||
52 | * @param string $type object type |
||
53 | * @param array $parameters parameters needed to load required object type |
||
54 | * @param int $responseType response type: single meta (LoaderInterface::SINGLE) or collection of metas (LoaderInterface::COLLECTION) |
||
55 | * |
||
56 | * @return Meta|MetaCollection false if meta cannot be loaded, a Meta instance otherwise |
||
57 | */ |
||
58 | public function load($type, $parameters = [], $responseType = LoaderInterface::SINGLE) |
||
90 | |||
91 | /** |
||
92 | * Checks if Loader supports provided type. |
||
93 | * |
||
94 | * @param string $type |
||
95 | * |
||
96 | * @return bool |
||
97 | */ |
||
98 | public function isSupported($type) |
||
102 | } |
||
103 |