1 | <?php |
||
27 | class PageManager extends TrackingManager |
||
28 | { |
||
29 | /** |
||
30 | * A reference to the collections available to this website. |
||
31 | * |
||
32 | * @var ContentItem[][] |
||
33 | */ |
||
34 | private $collections; |
||
35 | |||
36 | /** |
||
37 | * A place to store a reference to static PageViews with titles. |
||
38 | * |
||
39 | * @var PageView[] |
||
40 | */ |
||
41 | private $staticPages; |
||
42 | |||
43 | /** |
||
44 | * @var DataItem[]|array |
||
45 | */ |
||
46 | private $datasets; |
||
47 | |||
48 | /** |
||
49 | * PageManager constructor. |
||
50 | */ |
||
51 | 7 | public function __construct() |
|
52 | { |
||
53 | 7 | parent::__construct(); |
|
54 | |||
55 | 7 | $this->trackedItems = array( |
|
|
|||
56 | PageView::STATIC_TYPE => array(), |
||
57 | PageView::DYNAMIC_TYPE => array(), |
||
58 | PageView::REPEATER_TYPE => array(), |
||
59 | ); |
||
60 | 7 | $this->collections = array(); |
|
61 | 7 | $this->staticPages = array(); |
|
62 | 7 | } |
|
63 | |||
64 | /** |
||
65 | * Give this manager the collections we'll be using for dynamic PageViews. |
||
66 | * |
||
67 | * @param ContentItem[][] $collections |
||
68 | * |
||
69 | * @since 0.1.0 |
||
70 | */ |
||
71 | 4 | public function setCollections(&$collections) |
|
72 | { |
||
73 | 4 | $this->collections = &$collections; |
|
74 | 4 | } |
|
75 | |||
76 | public function setDatasets($datasets) |
||
77 | { |
||
78 | $this->datasets = $datasets; |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * Get all of the PageViews tracked by this manager. |
||
83 | * |
||
84 | * @todo Remove this function |
||
85 | * |
||
86 | * @deprecated Been replaced by getPageViewsFlattened() |
||
87 | * @since 0.1.0 |
||
88 | * |
||
89 | * @return PageView[][] |
||
90 | */ |
||
91 | public function getAllPageViews() |
||
95 | |||
96 | /** |
||
97 | * Get all of the PageViews in an associative array with PageView types as the keys. |
||
98 | * |
||
99 | * @since 0.1.1 |
||
100 | * |
||
101 | * @return PageView[][] |
||
102 | */ |
||
103 | public function &getPageViews() |
||
104 | { |
||
105 | return $this->trackedItems; |
||
106 | } |
||
107 | |||
108 | /** |
||
109 | * Get all of the PageViews in flat array. |
||
110 | * |
||
111 | * @since 0.1.1 |
||
112 | * |
||
113 | * @return PageView[] |
||
114 | */ |
||
115 | public function &getPageViewsFlattened() |
||
116 | { |
||
117 | return $this->trackedItemsFlattened; |
||
118 | } |
||
119 | |||
120 | /** |
||
121 | * Get the static PageViews tracked by this manager indexed by their title. |
||
122 | * |
||
123 | * @since 0.1.0 |
||
124 | * |
||
125 | * @return PageView[] |
||
126 | */ |
||
127 | 1 | public function getStaticPageViews() |
|
131 | |||
132 | /** |
||
133 | * Get the jailed version of the static PageViews indexed by their title. |
||
134 | * |
||
135 | * @since 0.1.0 |
||
136 | * |
||
137 | * @return JailedDocument[] |
||
138 | */ |
||
139 | 1 | public function getJailedStaticPageViews() |
|
150 | |||
151 | /** |
||
152 | * Go through all of the PageView directories and create a respective PageView for each and classify them as a |
||
153 | * dynamic or static PageView. |
||
154 | * |
||
155 | * @param string[] $pageViewFolders |
||
156 | * |
||
157 | * @since 0.1.0 |
||
158 | */ |
||
159 | 7 | public function parsePageViews($pageViewFolders) |
|
182 | |||
183 | /** |
||
184 | * Add a new ContentItem to the respective parent PageView of the ContentItem. |
||
185 | * |
||
186 | * @param ContentItem $contentItem |
||
187 | * |
||
188 | * @since 0.1.0 |
||
189 | */ |
||
190 | 1 | public function trackNewContentItem(&$contentItem) |
|
195 | |||
196 | /** |
||
197 | * {@inheritdoc} |
||
198 | */ |
||
199 | 6 | protected function &handleTrackableItem($filePath, array $options = array()) |
|
222 | |||
223 | /** |
||
224 | * Handle special behavior and treatment for static PageViews while we're iterating through them. |
||
225 | * |
||
226 | * @param PageView $pageView |
||
227 | * |
||
228 | * @since 0.1.0 |
||
229 | */ |
||
230 | 2 | private function handleTrackableStaticPageView(&$pageView) |
|
239 | |||
240 | /** |
||
241 | * Handle special behavior and treatment for dynamic PageViews while we're iterating through them. |
||
242 | * |
||
243 | * @param DynamicPageView $pageView |
||
244 | * |
||
245 | * @since 0.1.0 |
||
246 | */ |
||
247 | 4 | private function handleTrackableDynamicPageView(&$pageView) |
|
268 | } |
||
269 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..