Passed
Push — trunk ( b58f4c...bcd689 )
by Christian
17:43 queued 04:58
created

LandingPage::setNavigationId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Storefront\Page\LandingPage;
4
5
use Shopware\Core\Content\Cms\CmsPageEntity;
6
use Shopware\Core\Content\LandingPage\LandingPageDefinition;
7
use Shopware\Core\Content\LandingPage\LandingPageEntity;
8
use Shopware\Core\Framework\DataAbstractionLayer\EntityCustomFieldsTrait;
9
use Shopware\Core\Framework\Feature;
10
use Shopware\Storefront\Page\Page;
11
12
class LandingPage extends Page
13
{
14
    /* @deprecated tag:v6.5.0 Trait will be removed. customFields will be found under the cmsPage and landingPage */
15
    use EntityCustomFieldsTrait;
16
17
    /**
18
     * @var CmsPageEntity|null
19
     *
20
     * @deprecated tag:v6.5.0 $cmsPage will be removed. Use LandingPage->getLandingPage()->getCmsPage() instead
21
     */
22
    protected $cmsPage;
23
24
    protected ?LandingPageEntity $landingPage;
25
26
    /* @deprecated tag:v6.5.0 $navigationId will be removed. Get the Id from LandingPage->getLandingPage()->getId() */
27
    protected ?string $navigationId;
28
29
    /**
30
     * @var array<mixed>|null
31
     */
32
    protected $customFields;
33
34
    /**
35
     * @deprecated tag:v6.5.0 getCmsPage will be removed. Use LandingPage->getLandingPage()->getCmsPage() instead
36
     */
37
    public function getCmsPage(): ?CmsPageEntity
38
    {
39
        Feature::triggerDeprecationOrThrow(
40
            'v6.5.0.0',
41
            Feature::deprecatedMethodMessage(__CLASS__, 'getCmsPage', 'v6.5.0.0', 'LandingPage->getLandingPage()->getCmsPage()')
42
        );
43
44
        return $this->cmsPage;
0 ignored issues
show
Deprecated Code introduced by
The property Shopware\Storefront\Page...e\LandingPage::$cmsPage has been deprecated: tag:v6.5.0 $cmsPage will be removed. Use LandingPage->getLandingPage()->getCmsPage() instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

44
        return /** @scrutinizer ignore-deprecated */ $this->cmsPage;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
45
    }
46
47
    /**
48
     * @deprecated tag:v6.5.0 setCmsPage will be removed.
49
     */
50
    public function setCmsPage(CmsPageEntity $cmsPage): void
51
    {
52
        Feature::triggerDeprecationOrThrow(
53
            'v6.5.0.0',
54
            Feature::deprecatedMethodMessage(__CLASS__, 'setCmsPage', 'v6.5.0.0')
55
        );
56
57
        $this->cmsPage = $cmsPage;
0 ignored issues
show
Deprecated Code introduced by
The property Shopware\Storefront\Page...e\LandingPage::$cmsPage has been deprecated: tag:v6.5.0 $cmsPage will be removed. Use LandingPage->getLandingPage()->getCmsPage() instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

57
        /** @scrutinizer ignore-deprecated */ $this->cmsPage = $cmsPage;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
58
    }
59
60
    /**
61
     * @deprecated tag:v6.5.0 $navigationId will be removed. Get the Id from LandingPage->getLandingPage()->getId()
62
     */
63
    public function getNavigationId(): ?string
64
    {
65
        Feature::triggerDeprecationOrThrow(
66
            'v6.5.0.0',
67
            Feature::deprecatedMethodMessage(__CLASS__, 'getNavigationId', 'v6.5.0.0', 'LandingPage->getLandingPage()->getId()')
68
        );
69
70
        return $this->navigationId;
0 ignored issues
show
Deprecated Code introduced by
The property Shopware\Storefront\Page...dingPage::$navigationId has been deprecated: tag:v6.5.0 $navigationId will be removed. Get the Id from LandingPage->getLandingPage()->getId() ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

70
        return /** @scrutinizer ignore-deprecated */ $this->navigationId;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
71
    }
72
73
    /**
74
     * @deprecated tag:v6.5.0 $navigationId will be removed.
75
     */
76
    public function setNavigationId(?string $navigationId): void
77
    {
78
        Feature::triggerDeprecationOrThrow(
79
            'v6.5.0.0',
80
            Feature::deprecatedMethodMessage(__CLASS__, 'setNavigationId', 'v6.5.0.0')
81
        );
82
83
        $this->navigationId = $navigationId;
0 ignored issues
show
Deprecated Code introduced by
The property Shopware\Storefront\Page...dingPage::$navigationId has been deprecated: tag:v6.5.0 $navigationId will be removed. Get the Id from LandingPage->getLandingPage()->getId() ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

83
        /** @scrutinizer ignore-deprecated */ $this->navigationId = $navigationId;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
84
    }
85
86
    public function getEntityName(): string
87
    {
88
        return LandingPageDefinition::ENTITY_NAME;
89
    }
90
91
    public function getLandingPage(): ?LandingPageEntity
92
    {
93
        return $this->landingPage;
94
    }
95
96
    public function setLandingPage(?LandingPageEntity $landingPage): void
97
    {
98
        $this->landingPage = $landingPage;
99
    }
100
}
101