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

LineItemAddedEvent::getSalesChannelContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Checkout\Cart\Event;
4
5
use Shopware\Core\Checkout\Cart\Cart;
6
use Shopware\Core\Checkout\Cart\LineItem\LineItem;
7
use Shopware\Core\System\SalesChannel\SalesChannelContext;
8
use Symfony\Contracts\EventDispatcher\Event;
9
10
/**
11
 * @deprecated tag:v6.4.0 - Will implement Shopware\Core\Framework\Event\ShopwareSalesChannelEvent
12
 */
13
class LineItemAddedEvent extends Event /*implements ShopwareSalesChannelEvent*/
14
{
15
    /**
16
     * @var LineItem
17
     */
18
    protected $lineItem;
19
20
    /**
21
     * @var Cart
22
     */
23
    protected $cart;
24
25
    /**
26
     * @var SalesChannelContext
27
     */
28
    protected $context;
29
30
    /**
31
     * @var bool
32
     */
33
    protected $merged;
34
35
    public function __construct(LineItem $lineItem, Cart $cart, SalesChannelContext $context, bool $merged = false)
36
    {
37
        $this->lineItem = $lineItem;
38
        $this->cart = $cart;
39
        $this->context = $context;
40
        $this->merged = $merged;
41
    }
42
43
    public function getLineItem(): LineItem
44
    {
45
        return $this->lineItem;
46
    }
47
48
    public function getCart(): Cart
49
    {
50
        return $this->cart;
51
    }
52
53
    /**
54
     * @deprecated tag:v6.4.0 - Will return Shopware\Core\Framework\Context instead
55
     */
56
    public function getContext(): SalesChannelContext
57
    {
58
        return $this->context;
59
    }
60
61
    public function getSalesChannelContext(): SalesChannelContext
62
    {
63
        return $this->context;
64
    }
65
66
    public function isMerged(): bool
67
    {
68
        return $this->merged;
69
    }
70
}
71