-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathAbstractSetQuery.php
More file actions
82 lines (73 loc) · 1.6 KB
/
AbstractSetQuery.php
File metadata and controls
82 lines (73 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
/**
* Author: Nil Portugués Calderó <contact@nilportugues.com>
* Date: 12/24/14
* Time: 12:30 PM.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace NilPortugues\Sql\QueryBuilder\Manipulation;
use NilPortugues\Sql\QueryBuilder\Syntax\Table;
use NilPortugues\Sql\QueryBuilder\Syntax\Where;
use NilPortugues\Sql\QueryBuilder\Syntax\QueryPartInterface;
/**
* Class AbstractSetQuery.
*/
abstract class AbstractSetQuery implements QueryInterface, QueryPartInterface
{
/**
* @var array
*/
protected $union = [];
/**
* @param Select $select
*
* @return $this
*/
public function add(Select $select)
{
$this->union[] = $select;
return $this;
}
/**
* @return array
*/
public function getUnions()
{
return $this->union;
}
/**
* @throws QueryException
*
* @return Table
*/
public function getTable()
{
throw new QueryException(
\sprintf('%s does not support tables', $this->partName())
);
}
/**
* @throws QueryException
*
* @return Where
*/
public function getWhere()
{
throw new QueryException(
\sprintf('%s does not support WHERE.', $this->partName())
);
}
/**
* @throws QueryException
*
* @return Where
*/
public function where()
{
throw new QueryException(
\sprintf('%s does not support the WHERE statement.', $this->partName())
);
}
}