1 | <?php |
||
25 | class CollectionManager extends TrackingManager |
||
26 | { |
||
27 | /** @var string[][] A copy of the collection definitions to be available for later usage. */ |
||
28 | private $collectionDefinitions; |
||
29 | private $markupEngineManager; |
||
30 | private $configuration; |
||
31 | private $eventDispatcher; |
||
32 | private $logger; |
||
33 | |||
34 | /** |
||
35 | * CollectionManager constructor. |
||
36 | */ |
||
37 | 36 | public function __construct(MarkupEngineManager $markupEngineManager, Configuration $configuration, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger) |
|
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | 6 | public function compileManager() |
|
59 | |||
60 | /** |
||
61 | * Get all of the ContentItems grouped by Collection name. |
||
62 | * |
||
63 | * ```php |
||
64 | * [ |
||
65 | * 'collection name' => [ |
||
66 | * new ContentItem(), |
||
67 | * new ContentItem(), |
||
68 | * ] |
||
69 | * ] |
||
70 | * ``` |
||
71 | * |
||
72 | * @return ContentItem[][] |
||
73 | */ |
||
74 | 15 | public function &getCollections() |
|
78 | |||
79 | /** |
||
80 | * Get a ContentItem from a Collection passed on it's path. |
||
81 | * |
||
82 | * @param string $filePath |
||
83 | * |
||
84 | * @throws TrackedItemNotFoundException |
||
85 | * |
||
86 | * @return ContentItem |
||
87 | */ |
||
88 | 1 | public function &getContentItem($filePath) |
|
97 | |||
98 | /** |
||
99 | * A jailed representation of CollectionManager::getCollections(). |
||
100 | * |
||
101 | * @return JailedDocument[][] |
||
|
|||
102 | */ |
||
103 | 19 | public function getJailedCollections() |
|
107 | |||
108 | /** |
||
109 | * Parse every collection and store them in the manager. |
||
110 | * |
||
111 | * @param string[][] $collections An array of definitions for collections |
||
112 | */ |
||
113 | 36 | public function parseCollections($collections) |
|
159 | |||
160 | /** |
||
161 | * {@inheritdoc} |
||
162 | */ |
||
163 | 1 | public function createNewItem($filePath) |
|
171 | |||
172 | /** |
||
173 | * {@inheritdoc} |
||
174 | */ |
||
175 | public function refreshItem($filePath) |
||
178 | |||
179 | /** |
||
180 | * {@inheritdoc} |
||
181 | */ |
||
182 | 36 | protected function handleTrackableItem(File $filePath, array $options = []) |
|
205 | |||
206 | /** |
||
207 | * Get the name of the Collection this ContentItem belongs to based on its location. |
||
208 | * |
||
209 | * @param File $file |
||
210 | * |
||
211 | * @return string |
||
212 | */ |
||
213 | 1 | private function getCollectionNameFromPath(File $file) |
|
225 | } |
||
226 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.