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

Base::getContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2017-2021
6
 * @package Controller
7
 * @subpackage Common
8
 */
9
10
11
namespace Aimeos\Controller\Common\Order\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