Passed
Push — master ( 78ff77...606203 )
by Aimeos
04:53
created

Base   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 28
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A all() 0 9 2
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Metaways Infosystems GmbH, 2011
6
 * @copyright Aimeos (aimeos.org), 2015-2022
7
 * @package MW
8
 * @subpackage DB
9
 */
10
11
12
namespace Aimeos\Base\DB\Result;
13
14
15
/**
16
 * Base class with required constants for result objects
17
 *
18
 * @package MW
19
 * @subpackage DB
20
 */
21
abstract class Base implements Iface
22
{
23
	/**
24
	 * Fetch mode returning numerically indexed record arrays
25
	 */
26
	const FETCH_NUM = 0;
27
28
	/**
29
	 * Fetch mode returning associative indexed record arrays
30
	 */
31
	const FETCH_ASSOC = 1;
32
33
34
	/**
35
	 * Retrieves all row from database result set.
36
	 *
37
	 * @param int $style The data can be returned as associative or numerical array
38
	 * @return array Numeric or associative array of columns returned by the database
39
	 */
40
	public function all( int $style = \Aimeos\Base\DB\Result\Base::FETCH_ASSOC ) : array
41
	{
42
		$list = [];
43
44
		while( $row = $this->fetch( $style ) ) {
45
			$list[] = $row;
46
		}
47
48
		return $list;
49
	}
50
}
51