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

QueryCommand   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 2
dl 0
loc 40
ccs 0
cts 27
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getID() 0 4 1
A getQuery() 0 4 1
A setQuery() 0 8 2
A getSql() 0 10 2
A buildPacket() 0 2 1
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