Total Complexity | 7 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class ElementalPageExtension extends ElementalAreasExtension |
||
10 | { |
||
11 | private static $has_one = [ |
||
|
|||
12 | 'ElementalArea' => ElementalArea::class, |
||
13 | ]; |
||
14 | |||
15 | private static $owns = [ |
||
16 | 'ElementalArea', |
||
17 | ]; |
||
18 | |||
19 | private static $cascade_duplicates = [ |
||
20 | 'ElementalArea', |
||
21 | ]; |
||
22 | |||
23 | /** |
||
24 | * Returns the contents of each ElementalArea has_one's markup for use in Solr search indexing |
||
25 | * |
||
26 | * @return string |
||
27 | */ |
||
28 | public function getElementsForSearch() |
||
29 | { |
||
30 | $output = []; |
||
31 | foreach ($this->owner->hasOne() as $key => $class) { |
||
32 | if ($class !== ElementalArea::class) { |
||
33 | continue; |
||
34 | } |
||
35 | |||
36 | /** @var ElementalArea $area */ |
||
37 | $area = $this->owner->$key(); |
||
38 | if ($area) { |
||
39 | $output[] = strip_tags($area->forTemplate()); |
||
40 | } |
||
41 | } |
||
42 | return implode($output); |
||
43 | } |
||
44 | |||
45 | public function MetaTags(&$tags) |
||
58 | } |
||
59 | } |
||
61 |