AbstractCreationalQuery   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 42
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 3
A getValues() 0 4 1
A setValues() 0 6 1
1
<?php
2
/**
3
 * Author: Nil Portugués Calderó <[email protected]>
4
 * Date: 12/24/14
5
 * Time: 12:30 PM.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace NilPortugues\Sql\QueryBuilder\Manipulation;
12
13
/**
14
 * Class AbstractCreationalQuery.
15
 */
16
abstract class AbstractCreationalQuery extends AbstractBaseQuery
17
{
18
    /**
19
     * @var array
20
     */
21
    protected $values = [];
22
23
    /**
24
     * @param string $table
25
     * @param array  $values
26
     */
27
    public function __construct($table = null, array $values = null)
28
    {
29
        if (isset($table)) {
30
            $this->setTable($table);
31
        }
32
33
        if (!empty($values)) {
34
            $this->setValues($values);
35
        }
36
    }
37
38
    /**
39
     * @return array
40
     */
41
    public function getValues()
42
    {
43
        return $this->values;
44
    }
45
46
    /**
47
     * @param array $values
48
     *
49
     * @return $this
50
     */
51
    public function setValues(array $values)
52
    {
53
        $this->values = \array_filter($values);
54
55
        return $this;
56
    }
57
}
58