silverstripe /
silverstripe-elemental
| 1 | <?php |
||
| 2 | |||
| 3 | namespace DNADesign\Elemental\TopPage; |
||
| 4 | |||
| 5 | use DNADesign\Elemental\Models\BaseElement; |
||
| 6 | use DNADesign\Elemental\Models\ElementalArea; |
||
| 7 | use Page; |
||
| 8 | use SilverStripe\ORM\DataObject; |
||
| 9 | use SilverStripe\ORM\Queries\SQLUpdate; |
||
| 10 | use TractorCow\Fluent\State\FluentState; |
||
|
0 ignored issues
–
show
|
|||
| 11 | |||
| 12 | /** |
||
| 13 | * Class FluentExtension |
||
| 14 | * |
||
| 15 | * Use in place of @see DataExtension if you use the Fluent module for page localisation. |
||
| 16 | * Be sure to also update @see TestState to use this extension |
||
| 17 | * |
||
| 18 | * @link https://github.com/tractorcow-farm/silverstripe-fluent |
||
| 19 | * @property string $TopPageLocale |
||
| 20 | * @property BaseElement|ElementalArea|$this $owner |
||
| 21 | * @package DNADesign\Elemental\TopPage |
||
| 22 | */ |
||
| 23 | class FluentExtension extends DataExtension |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * @var array |
||
| 27 | */ |
||
| 28 | private static $db = [ |
||
|
0 ignored issues
–
show
|
|||
| 29 | 'TopPageLocale' => 'Varchar', |
||
| 30 | ]; |
||
| 31 | |||
| 32 | /* |
||
| 33 | * @inheritdoc |
||
| 34 | */ |
||
| 35 | protected function assignTopPage(Page $page): void |
||
| 36 | { |
||
| 37 | parent::assignTopPage($page); |
||
| 38 | |||
| 39 | $this->owner->TopPageLocale = FluentState::singleton()->getLocale(); |
||
|
0 ignored issues
–
show
The property
TopPageLocale does not exist on DNADesign\Elemental\Models\BaseElement. Since you implemented __set, consider adding a @property annotation.
Loading history...
The property
TopPageLocale does not exist on DNADesign\Elemental\Models\ElementalArea. Since you implemented __set, consider adding a @property annotation.
Loading history...
|
|||
| 40 | } |
||
| 41 | |||
| 42 | /* |
||
| 43 | * @inheritdoc |
||
| 44 | */ |
||
| 45 | protected function clearTopPage(): void |
||
| 46 | { |
||
| 47 | parent::clearTopPage(); |
||
| 48 | |||
| 49 | $this->owner->TopPageLocale = null; |
||
|
0 ignored issues
–
show
The property
TopPageLocale does not exist on DNADesign\Elemental\Models\ElementalArea. Since you implemented __set, consider adding a @property annotation.
Loading history...
The property
TopPageLocale does not exist on DNADesign\Elemental\Models\BaseElement. Since you implemented __set, consider adding a @property annotation.
Loading history...
|
|||
| 50 | } |
||
| 51 | |||
| 52 | /* |
||
| 53 | * @inheritdoc |
||
| 54 | */ |
||
| 55 | protected function assignFixedTopPage(): void |
||
| 56 | { |
||
| 57 | parent::assignFixedTopPage(); |
||
| 58 | |||
| 59 | $this->owner->TopPageLocale = FluentState::singleton()->getLocale(); |
||
|
0 ignored issues
–
show
The property
TopPageLocale does not exist on DNADesign\Elemental\Models\BaseElement. Since you implemented __set, consider adding a @property annotation.
Loading history...
The property
TopPageLocale does not exist on DNADesign\Elemental\Models\ElementalArea. Since you implemented __set, consider adding a @property annotation.
Loading history...
|
|||
| 60 | } |
||
| 61 | |||
| 62 | /* |
||
| 63 | * @inheritdoc |
||
| 64 | */ |
||
| 65 | protected function saveChanges(array $extraData = []): void |
||
| 66 | { |
||
| 67 | /** @var DataObject|FluentExtension $owner */ |
||
| 68 | $owner = $this->owner; |
||
| 69 | $extraData['"TopPageLocale"'] = $owner->TopPageLocale; |
||
| 70 | |||
| 71 | parent::saveChanges($extraData); |
||
| 72 | } |
||
| 73 | } |
||
| 74 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths