Passed
Push — master ( 51a972...dacf9c )
by Christian
10:27 queued 10s
created

ProductPageCriteriaEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCriteria() 0 3 1
A getProductId() 0 3 1
A getContext() 0 3 1
A getSalesChannelContext() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Storefront\Page\Product;
4
5
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
6
use Shopware\Core\System\SalesChannel\SalesChannelContext;
7
use Symfony\Contracts\EventDispatcher\Event;
8
9
/**
10
 * @deprecated tag:v6.4.0 - Will implement Shopware\Core\Framework\Event\ShopwareSalesChannelEvent
11
 */
12
class ProductPageCriteriaEvent extends Event /*implements ShopwareSalesChannelEvent*/
13
{
14
    /**
15
     * @var string
16
     */
17
    protected $productId;
18
19
    /**
20
     * @var Criteria
21
     */
22
    protected $criteria;
23
24
    /**
25
     * @var SalesChannelContext
26
     */
27
    protected $context;
28
29
    public function __construct(string $productId, Criteria $criteria, SalesChannelContext $context)
30
    {
31
        $this->productId = $productId;
32
        $this->criteria = $criteria;
33
        $this->context = $context;
34
    }
35
36
    public function getProductId(): string
37
    {
38
        return $this->productId;
39
    }
40
41
    public function getCriteria(): Criteria
42
    {
43
        return $this->criteria;
44
    }
45
46
    /**
47
     * @deprecated tag:v6.4.0 - Will return Shopware\Core\Framework\Context instead
48
     */
49
    public function getContext(): SalesChannelContext
50
    {
51
        return $this->context;
52
    }
53
54
    public function getSalesChannelContext(): SalesChannelContext
55
    {
56
        return $this->context;
57
    }
58
}
59