1 | <?php |
||
13 | class RepeaterPageView extends BasePageView implements TemplateReadyDocument |
||
14 | { |
||
15 | /** @var ExpandedValue[] All of the expanded permalinks. */ |
||
16 | private $permalinks; |
||
17 | |||
18 | /** @var ExpandedValue[][] All of expanded redirects that should point to the respective permalink; this is estimated by index. */ |
||
19 | private $redirectLinks; |
||
20 | |||
21 | /** |
||
22 | * RepeaterPageView constructor. |
||
23 | */ |
||
24 | 3 | public function __construct(File $file) |
|
25 | { |
||
26 | 3 | parent::__construct($file); |
|
27 | |||
28 | 3 | $this->type = BasePageView::REPEATER_TYPE; |
|
29 | 3 | } |
|
30 | |||
31 | /** |
||
32 | * Get the permalink matching all the placeholders for a Repeater. |
||
33 | * |
||
34 | * @param array $where |
||
35 | * |
||
36 | * @return null|string |
||
37 | */ |
||
38 | public function _getPermalinkWhere(array $where) |
||
39 | { |
||
40 | foreach ($this->permalinks as $expandedValue) |
||
41 | { |
||
42 | if ($expandedValue->getIterators() === $where) |
||
43 | { |
||
44 | return $expandedValue->getEvaluated(); |
||
45 | } |
||
46 | } |
||
47 | |||
48 | return null; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * Get the expanded values for the permalinks to this PageView. |
||
53 | * |
||
54 | * @return ExpandedValue[] |
||
55 | */ |
||
56 | 3 | public function getRepeaterPermalinks() |
|
60 | |||
61 | /** |
||
62 | * Get the expanded values for the redirects pointing to this PageView. |
||
63 | * |
||
64 | * @return ExpandedValue[][] |
||
65 | */ |
||
66 | 3 | public function getRepeaterRedirects() |
|
70 | |||
71 | /** |
||
72 | * Configure permalinks from expanded values internally. |
||
73 | */ |
||
74 | 3 | public function configurePermalinks() |
|
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function buildPermalink($force = false) |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | 3 | public function createJail() |
|
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function jsonSerialize() |
||
109 | } |
||
110 |