CursorAwareTrait::setUseCursor()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
/**
4
 * This software package is licensed under AGPL or Commercial license.
5
 *
6
 * @package maslosoft/mangan
7
 * @licence AGPL or Commercial
8
 * @copyright Copyright (c) Piotr Masełkowski <[email protected]>
9
 * @copyright Copyright (c) Maslosoft
10
 * @copyright Copyright (c) Others as mentioned in code
11
 * @link https://maslosoft.com/mangan/
12
 */
13
14
namespace Maslosoft\Mangan\Traits\Criteria;
15
16
use Maslosoft\Mangan\Interfaces\Criteria\CursorAwareInterface;
17
use Maslosoft\Mangan\Interfaces\CriteriaInterface;
18
19
/**
20
 * CursorAwareTrait
21
 * @see CursorAwareInterface
22
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
23
 */
24
trait CursorAwareTrait
25
{
26
27
	private $_useCursor = null;
28
29
	/**
30
	 * Whenever to use cursor
31
	 * @return bool Whever to use Cursor
32
	 */
33
	public function getUseCursor()
34
	{
35
		return $this->_useCursor;
36
	}
37
38
	/**
39
	 * Use cursor for fetching data
40
	 * @param bool $useCursor Whenever to use cursor
41
	 * @return CriteriaInterface
42
	 */
43
	public function setUseCursor($useCursor)
44
	{
45
		$this->_useCursor = $useCursor;
46
		return $this;
47
	}
48
49
}
50