Completed
Push — master ( ece51a...7e2c41 )
by Beniamin
02:51
created

AbstractInsertBuilder::getColumns()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * This file is part of Phuria SQL Builder package.
5
 *
6
 * Copyright (c) 2016 Beniamin Jonatan Šimko
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Phuria\SQLBuilder\QueryBuilder;
13
14
use Phuria\SQLBuilder\Table\AbstractTable;
15
16
/**
17
 * @author Beniamin Jonatan Šimko <[email protected]>
18
 */
19
abstract class AbstractInsertBuilder extends AbstractBuilder implements Component\TableComponentInterface
20
{
21
    use Component\TableComponentTrait;
22
23
    /**
24
     * @var array
25
     */
26
    private $columns = [];
27
28
    /**
29
     * @param array $columns
30
     *
31
     * @return $this
32
     */
33 2
    public function setColumns($columns)
34
    {
35 2
        $this->columns = $columns;
36
37 2
        return $this;
38
    }
39
40
    /**
41
     * @return array
42
     */
43 2
    public function getColumns()
44
    {
45 2
        return $this->columns;
46
    }
47
48
    /**
49
     * @param mixed $table
50
     * @param array $columns
51
     *
52
     * @return AbstractTable
53
     */
54 2
    public function into($table, array $columns = [])
55
    {
56 2
        if (count($columns)) {
57 1
            $this->setColumns($columns);
58 1
        }
59
60 2
        return $this->addRootTable($table);
61
    }
62
}