Completed
Push — master ( 3097a5...bdf786 )
by Ron
03:10
created

RunnableUpdate::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 2
c 0
b 0
f 0
rs 10
cc 1
eloc 1
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
class RunnableUpdate extends Update implements DDLPreparable {
9
	use CreateDDLRunnable;
10
11
	/**
12
	 * @param array $params
13
	 * @return int
14
	 */
15
	public function run(array $params = []) {
16
		$query = $this->__toString();
17
		return $this->db()->exec($query, $params);
18
	}
19
20
	/**
21
	 */
22
	public function prepare() {
23
		return $this->createPreparable($this->db()->prepare($this));
24
	}
25
}
26