Completed
Push — master ( 353d0e...6c7828 )
by Ron
01:57
created

RunnableUpdate::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 3
Ratio 100 %

Importance

Changes 0
Metric Value
dl 3
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
namespace Kir\MySQL\Builder;
3
4
use Kir\MySQL\Builder\Internal\DDLPreparable;
5
use Kir\MySQL\Builder\Traits\CreateDDLRunnable;
6
use Kir\MySQL\Databases\MySQL;
7
8 View Code Duplication
class RunnableUpdate extends Update implements DDLPreparable {
9
	use CreateDDLRunnable;
10
	
11
	/**
12
	 * @param MySQL $db
13
	 * @param array $options
14
	 */
15
	public function __construct(MySQL $db, array $options = []) {
0 ignored issues
show
Unused Code introduced by
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
16
		parent::__construct($db);
17
	}
18
19
	/**
20
	 * @param array $params
21
	 * @return int
22
	 */
23
	public function run(array $params = array()) {
24
		$query = $this->__toString();
25
		return $this->db()->exec($query, $params);
26
	}
27
28
	/**
29
	 */
30
	public function prepare() {
31
		return $this->createPreparable($this->db()->prepare($this));
32
	}
33
}
34