Passed
Push — master ( 494e53...aeeda4 )
by Aimeos
09:49
created

Standard::value()   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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2022
6
 * @package MShop
7
 * @subpackage Common
8
 */
9
10
11
namespace Aimeos\MShop\Common\Cursor;
12
13
14
/**
15
 * Default implementation for manager iterators
16
 *
17
 * @package MShop
18
 * @subpackage Common
19
 */
20
class Standard implements Iface
21
{
22
	private $filter;
23
	private $value;
24
25
26
	/**
27
	 * Initializes the object
28
	 *
29
	 * @param \Aimeos\Base\Criteria\Iface $filter Criteria object with conditions, sortations, etc.
30
	 * @param \Aimeos\Base\DB\Result\Iface $result Result set to iterate over
31
	 */
32
	public function __construct( \Aimeos\Base\Criteria\Iface $filter )
33
	{
34
		$this->filter = $filter;
35
	}
36
37
38
	/**
39
	 * Returns the filter criteria object
40
	 *
41
	 * @return \Aimeos\Base\Criteria\Iface Filter criteria object
42
	 */
43
	public function filter() : \Aimeos\Base\Criteria\Iface
44
	{
45
		return clone $this->filter;
46
	}
47
48
49
	/**
50
	 * Sets the new cursor value
51
	 *
52
	 * @return mixed $value Cursor value
53
	 */
54
	public function setValue( $value ) : \Aimeos\MShop\Common\Cursor\Iface
55
	{
56
		$this->value = $value;
57
		return $this;
58
	}
59
60
61
	/**
62
	 * Returns the cursor value
63
	 *
64
	 * @return mixed Cursor value
65
	 */
66
	public function value()
67
	{
68
		return $this->value;
69
	}
70
}
71