1 | <?php |
||
12 | class RepeaterPageView extends PageView |
||
13 | { |
||
14 | /** |
||
15 | * An iterator for the permalinks used in order for this entity to be treated as a static PageView. |
||
16 | * |
||
17 | * @var \ArrayIterator |
||
18 | */ |
||
19 | private $permalinksIterator; |
||
20 | |||
21 | /** |
||
22 | * All of the expanded permalinks. |
||
23 | * |
||
24 | * @var ExpandedValue[] |
||
25 | */ |
||
26 | private $permalinks; |
||
27 | |||
28 | /** |
||
29 | * All of expanded redirects that should point to the respective permalink; this is estimated by index. |
||
30 | * |
||
31 | * @var ExpandedValue[][] |
||
32 | */ |
||
33 | private $redirectLinks; |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | 2 | public function __construct($filePath) |
|
46 | |||
47 | /** |
||
48 | * Get the expanded values for the permalinks to this PageView. |
||
49 | * |
||
50 | * @return ExpandedValue[] |
||
51 | */ |
||
52 | public function getRepeaterPermalinks() |
||
53 | { |
||
54 | return $this->permalinks; |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Get the expanded values for the redirects pointing to this PageView. |
||
59 | * |
||
60 | * @return ExpandedValue[][] |
||
61 | */ |
||
62 | public function getRepeaterRedirects() |
||
63 | { |
||
64 | return $this->redirectLinks; |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * When looping through permalinks in a RepeaterPageView, the permalink needs to be updated each time so that it may |
||
69 | * behave as a static PageView. |
||
70 | */ |
||
71 | public function bumpPermalink() |
||
72 | { |
||
73 | $this->permalink = $this->permalinksIterator->current()->getEvaluated(); |
||
74 | $this->permalinksIterator->next(); |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * Rewind the permalink iterator to the beginning. |
||
79 | */ |
||
80 | 2 | public function rewindPermalink() |
|
84 | |||
85 | /** |
||
86 | * Setup this object. |
||
87 | */ |
||
88 | 2 | private function configureValues() |
|
101 | } |
||
102 |