Passed
Push — master ( 03c559...68c33f )
by Aimeos
02:29
created

Base::renewAfter()   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 2
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
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 getContext()
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
	 */
52
	public function begin( \Aimeos\MShop\Subscription\Item\Iface $subscription )
53
	{
54
	}
55
56
57
	/**
58
	 * Processes the subscription renewal
59
	 *
60
	 * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item
61
	 * @param \Aimeos\MShop\Order\Item\Iface $order Order invoice item
62
	 * @deprecated 2020.01 Use renewAfter() instead
63
	 */
64
	public function renew( \Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Iface $order )
65
	{
66
	}
67
68
69
	/**
70
	 * Executed before the subscription renewal
71
	 *
72
	 * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item
73
	 */
74
	public function renewBefore( \Aimeos\MShop\Subscription\Item\Iface $subscription )
75
	{
76
	}
77
78
79
	/**
80
	 * Executed after the subscription renewal
81
	 *
82
	 * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item
83
	 * @param \Aimeos\MShop\Order\Item\Iface $order Order invoice item
84
	 */
85
	public function renewAfter( \Aimeos\MShop\Subscription\Item\Iface $subscription, \Aimeos\MShop\Order\Item\Iface $order )
86
	{
87
		$this->renew( $subscription, $order );
88
	}
89
90
91
	/**
92
	 * Processes the end of the subscription
93
	 *
94
	 * @param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item
95
	 */
96
	public function end( \Aimeos\MShop\Subscription\Item\Iface $subscription )
97
	{
98
	}
99
}
100