Total Complexity | 4 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | class FluentExtension extends Extension |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * Add the needed language copy fields to Solr |
||
25 | */ |
||
26 | public function onAfterInit() |
||
27 | { |
||
28 | $locales = Locale::get()->exclude(['IsGlobalDefault' => true]); |
||
29 | /** @var BaseIndex $owner */ |
||
30 | $owner = $this->owner; |
||
31 | $copyFields = $owner->getCopyFields(); |
||
32 | /** @var Locale $locale */ |
||
33 | foreach ($locales as $locale) { |
||
34 | foreach ($copyFields as $copyField => $values) { |
||
35 | $owner->addCopyField($locale->Locale . $copyField, $values); |
||
36 | } |
||
37 | } |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @param $foundData |
||
42 | */ |
||
43 | public function getModifiedData($foundData) |
||
45 | // @todo check modify the found data with the specifics for each language |
||
46 | // Should return a set. Or maybe a simple array? If it's there, we can filter |
||
49 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.