1 | <?php |
||
18 | class DynamicPageView extends PageView |
||
19 | { |
||
20 | /** |
||
21 | * The RepeatableItems that belong to this PageView. |
||
22 | * |
||
23 | * @var RepeatableItem[] |
||
24 | */ |
||
25 | private $repeatableItems; |
||
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | 6 | public function __construct($filePath) |
|
37 | |||
38 | /** |
||
39 | * Add a RepeatableItem to this dynamic PageView. |
||
40 | * |
||
41 | * @param RepeatableItem $repeatableItem |
||
42 | */ |
||
43 | 5 | public function addRepeatableItem(RepeatableItem &$repeatableItem) |
|
48 | |||
49 | /** |
||
50 | * Remove a RepeatableItem from the list of items that this dynamic PageView is responsible for. |
||
51 | * |
||
52 | * @param RepeatableItem $repeatableItem |
||
53 | */ |
||
54 | public function delRepeatableItem(RepeatableItem &$repeatableItem) |
||
58 | |||
59 | /** |
||
60 | * Get all of the RepeatableItem that belong to this dynamic PageView. |
||
61 | * |
||
62 | * @return RepeatableItem[] |
||
63 | */ |
||
64 | 4 | public function getRepeatableItems() |
|
68 | |||
69 | 3 | public function getRepeatableNamespace() |
|
|
|||
70 | { |
||
71 | 3 | $fm = $this->getFrontMatter(false); |
|
72 | |||
73 | 3 | if (isset($fm['collection'])) |
|
74 | 3 | { |
|
75 | 3 | return $fm['collection']; |
|
76 | } |
||
77 | |||
78 | return $fm['dataset']; |
||
79 | } |
||
80 | |||
81 | 3 | public function getObjectName() |
|
85 | } |
||
86 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.