1 | <?php |
||
32 | trait UnionTrait |
||
33 | { |
||
34 | /** |
||
35 | * 0 NO, 1 YES, 2 UNION ALL |
||
36 | * @var int |
||
37 | * @access protected |
||
38 | */ |
||
39 | protected $is_union = UnionInterface::UNION_NOT; |
||
40 | |||
41 | /** |
||
42 | * Previous statement used in UNION/UNION ALL |
||
43 | * |
||
44 | * @var SelectStatementInterface |
||
45 | * @access protected |
||
46 | */ |
||
47 | protected $previous; |
||
48 | |||
49 | /** |
||
50 | * {@inheritDoc} |
||
51 | */ |
||
52 | public function union()/*# : SelectStatementInterface */ |
||
57 | |||
58 | /** |
||
59 | * {@inheritDoc} |
||
60 | */ |
||
61 | public function unionAll()/*# : SelectStatementInterface */ |
||
66 | |||
67 | /** |
||
68 | * Override `getStatement()` in StatementAbstract |
||
69 | * |
||
70 | * {@inheritDoc} |
||
71 | */ |
||
72 | public function getStatement(array $settings = [])/*# : string */ |
||
91 | |||
92 | /** |
||
93 | * Build UNION/UNION ALL |
||
94 | * |
||
95 | * @param string $prefix |
||
96 | * @param array $settings |
||
97 | * @return string |
||
98 | * @access protected |
||
99 | */ |
||
100 | protected function buildUnion( |
||
113 | |||
114 | /** |
||
115 | * Set previous SELECT |
||
116 | * |
||
117 | * @param SelectStatementInterface $select |
||
118 | * @return $this |
||
119 | * @access protected |
||
120 | */ |
||
121 | protected function setPrevious(SelectStatementInterface $select) |
||
126 | |||
127 | /** |
||
128 | * Has previous SELECT ? |
||
129 | * |
||
130 | * @return bool |
||
131 | * @access protected |
||
132 | */ |
||
133 | protected function hasPrevious()/*# : bool */ |
||
137 | |||
138 | /** |
||
139 | * Get previous SELECT |
||
140 | * |
||
141 | * @return SelectStatementInterface |
||
142 | * @access protected |
||
143 | */ |
||
144 | protected function getPrevious()/*# : SelectStatementInterface */ |
||
148 | |||
149 | /** |
||
150 | * Return the builder |
||
151 | * |
||
152 | * @return BuilderInterface |
||
153 | * @access public |
||
154 | */ |
||
155 | abstract public function getBuilder()/*# : BuilderInterface */; |
||
159 | } |
||
160 |
As per the PSR-2 coding standard, there must not be a space in front of the colon in case statements.
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.