Test Setup Failed
Branch master (10fdc5)
by Beniamin
35:44
created

AbstractInsertBuilder::getColumns()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
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\UnderQuery\QueryBuilder;
13
14
use Phuria\UnderQuery\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
    public function setColumns($columns)
34
    {
35
        $this->columns = $columns;
36
37
        return $this;
38
    }
39
40
    /**
41
     * @return array
42
     */
43
    public function getColumns()
44
    {
45
        return $this->columns;
46
    }
47
48
    /**
49
     * @param mixed $table
50
     * @param array $columns
51
     *
52
     * @return AbstractTable
53
     */
54
    public function into($table, array $columns = [])
55
    {
56
        if (count($columns)) {
57
            $this->setColumns($columns);
58
        }
59
60
        return $this->addRootTable($table);
61
    }
62
}