Completed
Push — master ( 3662e6...2c1d81 )
by Chris
02:54
created

Result::setInfo()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13
Code Lines 9

Duplication

Lines 13
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 13
loc 13
rs 9.4286
cc 3
eloc 9
nc 3
nop 1
1
<?php
2
namespace Darya\Storage;
3
4
use Darya\Storage\AbstractResult;
5
use Darya\Storage\Error;
6
use Darya\Storage\Query;
7
8
/**
9
 * Darya's storage query result.
10
 * 
11
 * @property array $data     Result data
12
 * @property Query $query    Query that produced this result
13
 * @property int   $count    Result count
14
 * @property Error $error    Result error
15
 * @property array $fields   Field names for each result data row
16
 * @property int   $insertId Insert ID
17
 * @property int   $affected Rows affected
18
 * 
19
 * @author Chris Andrew <[email protected]>
20
 */
21
class Result extends AbstractResult {
22
	
23
	/**
24
	 * The storage query that produced this result.
25
	 * 
26
	 * @var Query
27
	 */
28
	protected $query;
29
	
30
	/**
31
	 * The error that occurred when executing the query, if any.
32
	 * 
33
	 * @var Error|null
34
	 */
35
	protected $error;
36
	
37
	/**
38
	 * Instantiate a new storage query result.
39
	 * 
40
	 * @param Query $query
41
	 * @param array $data  [optional]
42
	 * @param array $info  [optional]
43
	 * @param Error $error [optional]
44
	 */
45
	public function __construct(Query $query, array $data = array(), array $info = array(), Error $error = null) {
46
		$this->query = $query;
47
		$this->data = $data;
48
		$this->error = $error;
49
		
50
		$this->setInfo($info);
51
	}
52
	
53
}
54