AbstractSetQuery::getTable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4286
cc 1
eloc 3
nc 1
nop 0
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
use NilPortugues\Sql\QueryBuilder\Syntax\QueryPartInterface;
14
15
/**
16
 * Class AbstractSetQuery.
17
 */
18
abstract class AbstractSetQuery implements QueryInterface, QueryPartInterface
19
{
20
    /**
21
     * @var array
22
     */
23
    protected $union = [];
24
25
    /**
26
     * @param Select $select
27
     *
28
     * @return $this
29
     */
30
    public function add(Select $select)
31
    {
32
        $this->union[] = $select;
33
34
        return $this;
35
    }
36
37
    /**
38
     * @return array
39
     */
40
    public function getUnions()
41
    {
42
        return $this->union;
43
    }
44
45
    /**
46
     * @throws QueryException
47
     *
48
     * @return \NilPortugues\Sql\QueryBuilder\Syntax\Table
49
     */
50
    public function getTable()
51
    {
52
        throw new QueryException(
53
            \sprintf('%s does not support tables', $this->partName())
54
        );
55
    }
56
57
    /**
58
     * @throws QueryException
59
     *
60
     * @return \NilPortugues\Sql\QueryBuilder\Syntax\Where
61
     */
62
    public function getWhere()
63
    {
64
        throw new QueryException(
65
            \sprintf('%s does not support WHERE.', $this->partName())
66
        );
67
    }
68
69
    /**
70
     * @throws QueryException
71
     *
72
     * @return \NilPortugues\Sql\QueryBuilder\Syntax\Where
73
     */
74
    public function where()
75
    {
76
        throw new QueryException(
77
            \sprintf('%s does not support the WHERE statement.', $this->partName())
78
        );
79
    }
80
}
81