Completed
Push — master ( 21bf70...cc5276 )
by Kamil
05:50
created

QueryCommand::getID()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Dazzle\MySQL\Command\Concrete;
4
5
use Dazzle\MySQL\Command\Command;
6
use Dazzle\MySQL\Query;
7
8
class QueryCommand extends Command
9
{
10
    public $query;
11
    public $fields;
12
    public $insertId;
13
    public $affectedRows;
14
15
    public function getID()
16
    {
17
        return self::QUERY;
18
    }
19
20
    public function getQuery()
21
    {
22
        return $this->query;
23
    }
24
25
    public function setQuery($query)
26
    {
27
        if (! $query instanceof Query)
28
        {
29
            $query = new Query($query);
30
        }
31
        $this->query = $query;
32
    }
33
34
    public function getSql()
35
    {
36
        $query = $this->query;
37
38
        if ($query instanceof Query)
39
        {
40
            return $query->getSql();
41
        }
42
        return $query;
43
    }
44
45
    public function buildPacket()
46
    {}
47
}
48