Passed
Push — master ( 108d2e...42466b )
by Aimeos
24:07 queued 21:25
created

Base::context()   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
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2018-2021
6
 * @package Controller
7
 * @subpackage Common
8
 */
9
10
11
namespace Aimeos\Controller\Common\Subscription\Process\Processor;
12
13
14
/**
15
 * Abstract class with common methods for all subscription processors
16
 *
17
 * @package Controller
18
 * @subpackage Common
19
 */
20
class Base
21
{
22
	private $context;
23
24
25
	/**
26
	 * Initializes the object
27
	 *
28
	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
29
	 */
30
	public function __construct( \Aimeos\MShop\Context\Item\Iface $context )
31
	{
32
		$this->context = $context;
33
	}
34
35
36
	/**
37
	 * Returns the context item
38
	 *
39
	 * @return \Aimeos\MShop\Context\Item\Iface Context object
40
	 */
41
	protected function context() : \Aimeos\MShop\Context\Item\Iface
42
	{
43
		return $this->context;
44
	}
45
46
47
	/**
48
	 * Processes the initial subscription
49
	 *
50
	 * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item
51
	 * @todo 2021.01 Add \Aimeos\MShop\Order\Item\Iface $order as second parameter
52
	 */
53
	public function begin( \Aimeos\MShop\Subscription\Item\Iface $subscription )
54
	{
55
	}
56
57
58
	/**
59
	 * Executed before the subscription renewal
60
	 *
61
	 * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item
62
	 * @todo 2021.01 Add \Aimeos\MShop\Order\Item\Iface $order as second parameter
63
	 */
64
	public function renewBefore( \Aimeos\MShop\Subscription\Item\Iface $subscription )
65
	{
66
	}
67
68
69
	/**
70
	 * Executed after the subscription renewal
71
	 *
72
	 * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item
73
	 * @param \Aimeos\MShop\Order\Item\Iface $order Order invoice item
74
	 */
75
	public function renewAfter( \Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Iface $order )
76
	{
77
	}
78
79
80
	/**
81
	 * Processes the end of the subscription
82
	 *
83
	 * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item
84
	 * @todo 2021.01 Add \Aimeos\MShop\Order\Item\Iface $order as second parameter
85
	 */
86
	public function end( \Aimeos\MShop\Subscription\Item\Iface $subscription )
87
	{
88
	}
89
}
90