Completed
Push — master ( f0b462...8318dd )
by Rasmus
03:32
created

SQLQuery   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 36
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getSQL() 0 4 1
A getMappers() 0 4 1
1
<?php
2
3
namespace mindplay\sql\model\query;
4
5
use mindplay\sql\framework\MapperProvider;
6
use mindplay\sql\model\components\Mappers;
7
use mindplay\sql\model\TypeProvider;
8
9
/**
10
 * This class represents a custom SQL Query.
11
 */
12
class SQLQuery extends Query implements MapperProvider
13
{
14
    use Mappers;
15
    
16
    /**
17
     * @var string
18
     */
19
    private $sql;
20
21
    /**
22
     * @param TypeProvider $types
23
     * @param string       $sql SQL statement (with placeholders)
24
     */
25 1
    public function __construct(TypeProvider $types, $sql)
26
    {
27 1
        parent::__construct($types);
28
        
29 1
        $this->sql = $sql;
30 1
    }
31
    
32
    /**
33
     * @inheritdoc
34
     */
35 1
    public function getSQL()
36
    {
37 1
        return $this->sql;
38
    }
39
40
    /**
41
     * @inheritdoc
42
     */
43 1
    public function getMappers()
44
    {
45 1
        return $this->mappers;
46
    }
47
}
48