Completed
Push — master ( 4ccffb...101fcc )
by Beniamin
03:58
created

AbstractInsertBuilder::into()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 2
crap 2
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
20
    Clause\InsertColumnsClauseInterface,
21
    Component\TableComponentInterface
22
{
23
    use Clause\InsertColumnsClauseTrait;
24
    use Component\TableComponentTrait;
25
26
    /**
27
     * @param mixed $table
28
     * @param array $columns
29
     *
30
     * @return AbstractTable
31
     */
32 2
    public function into($table, array $columns = [])
33
    {
34 2
        if (count($columns)) {
35 1
            $this->setColumns($columns);
36 1
        }
37
38 2
        return $this->addRootTable($table);
39
    }
40
}