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

Base   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 38
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getMapping() 0 3 1
A context() 0 3 1
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\Export\Csv\Processor;
12
13
14
/**
15
 * Abstract class with common methods for all order CSV export processors
16
 *
17
 * @package Controller
18
 * @subpackage Common
19
 */
20
class Base
21
{
22
	private $context;
23
	private $mapping;
24
25
26
	/**
27
	 * Initializes the object
28
	 *
29
	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
30
	 * @param array $mapping Associative list of field position in CSV as key and domain item key as value
31
	 */
32
	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, array $mapping )
33
	{
34
		$this->context = $context;
35
		$this->mapping = $mapping;
36
	}
37
38
39
	/**
40
	 * Returns the context item
41
	 *
42
	 * @return \Aimeos\MShop\Context\Item\Iface Context object
43
	 */
44
	protected function context() : \Aimeos\MShop\Context\Item\Iface
45
	{
46
		return $this->context;
47
	}
48
49
50
	/**
51
	 * Returns the mapping list
52
	 *
53
	 * @return array Associative list of field positions in CSV as keys and domain item keys as values
54
	 */
55
	protected function getMapping() : array
56
	{
57
		return $this->mapping;
58
	}
59
}
60