1 | <?php |
||
35 | class ArticleLoader extends PaginatedLoader implements LoaderInterface |
||
36 | { |
||
37 | /** |
||
38 | * @var ArticleProviderInterface |
||
39 | */ |
||
40 | protected $articleProvider; |
||
41 | |||
42 | /** |
||
43 | * @var RouteProviderInterface |
||
44 | */ |
||
45 | protected $routeProvider; |
||
46 | |||
47 | /** |
||
48 | * @var ObjectManager |
||
49 | */ |
||
50 | protected $dm; |
||
51 | |||
52 | /** |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $routeBasepaths; |
||
56 | |||
57 | /** |
||
58 | * @var MetaFactoryInterface |
||
59 | */ |
||
60 | protected $metaFactory; |
||
61 | |||
62 | /** |
||
63 | * @var Context |
||
64 | */ |
||
65 | protected $context; |
||
66 | |||
67 | /** |
||
68 | * ArticleLoader constructor. |
||
69 | * |
||
70 | * @param ArticleProviderInterface $articleProvider |
||
71 | * @param RouteProviderInterface $routeProvider |
||
72 | * @param ObjectManager $dm |
||
73 | * @param MetaFactoryInterface $metaFactory |
||
74 | * @param Context $context |
||
75 | */ |
||
76 | 91 | public function __construct( |
|
89 | |||
90 | /** |
||
91 | * Load meta object by provided type and parameters. |
||
92 | * |
||
93 | * @MetaLoaderDoc( |
||
94 | * description="Article Loader loads articles from Content Repository", |
||
95 | * parameters={ |
||
96 | * contentPath="SINGLE|required content path", |
||
97 | * slug="SINGLE|required content slug", |
||
98 | * pageName="COLLECTiON|name of Page for required articles" |
||
99 | * } |
||
100 | * ) |
||
101 | * |
||
102 | * @param string $type object type |
||
103 | * @param array $parameters parameters needed to load required object type |
||
104 | * @param int $responseType response type: single meta (LoaderInterface::SINGLE) or collection of metas (LoaderInterface::COLLECTION) |
||
105 | * |
||
106 | * @return Meta|Meta[]|bool false if meta cannot be loaded, a Meta instance otherwise |
||
107 | * |
||
108 | * @throws \Exception |
||
109 | */ |
||
110 | 10 | public function load($type, $parameters = [], $responseType = LoaderInterface::SINGLE) |
|
171 | |||
172 | /** |
||
173 | * Checks if Loader supports provided type. |
||
174 | * |
||
175 | * @param string $type |
||
176 | * |
||
177 | * @return bool |
||
178 | */ |
||
179 | 14 | public function isSupported(string $type): bool |
|
183 | |||
184 | 8 | private function getArticleMeta($article) |
|
192 | } |
||
193 |