1 | <?php |
||
11 | abstract class AbstractTable |
||
12 | { |
||
13 | const CROSS_JOIN = 'CROSS JOIN'; |
||
14 | const LEFT_JOIN = 'LEFT JOIN'; |
||
15 | const INNER_JOIN = 'INNER JOIN'; |
||
16 | |||
17 | /** |
||
18 | * @var QueryBuilder $qb |
||
19 | */ |
||
20 | private $qb; |
||
21 | |||
22 | /** |
||
23 | * @var string $tableAlias |
||
24 | */ |
||
25 | private $tableAlias; |
||
26 | |||
27 | /** |
||
28 | * @var string $joinType |
||
29 | */ |
||
30 | private $joinType; |
||
31 | |||
32 | /** |
||
33 | * @var string $joinOn |
||
34 | */ |
||
35 | private $joinOn; |
||
36 | |||
37 | /** |
||
38 | * @var bool $root |
||
39 | */ |
||
40 | private $root = false; |
||
41 | |||
42 | /** |
||
43 | * @var bool $join |
||
44 | */ |
||
45 | private $join = false; |
||
46 | |||
47 | /** |
||
48 | * @param QueryBuilder $qb |
||
49 | */ |
||
50 | 22 | public function __construct(QueryBuilder $qb) |
|
54 | |||
55 | /** |
||
56 | * @return ReferenceManager |
||
57 | */ |
||
58 | 13 | public function __toString() |
|
62 | |||
63 | /** |
||
64 | * @return string |
||
65 | */ |
||
66 | abstract public function getTableName(); |
||
67 | |||
68 | /** |
||
69 | * @inheritdoc |
||
70 | */ |
||
71 | public function compile() |
||
91 | |||
92 | /** |
||
93 | * @return string |
||
94 | */ |
||
95 | 20 | public function getAlias() |
|
99 | |||
100 | /** |
||
101 | * @param string $alias |
||
102 | * |
||
103 | * @return $this |
||
104 | */ |
||
105 | 8 | public function setAlias($alias) |
|
111 | |||
112 | /** |
||
113 | * @return bool |
||
114 | */ |
||
115 | 19 | public function isJoin() |
|
119 | |||
120 | /** |
||
121 | * @return string |
||
122 | */ |
||
123 | 3 | public function getJoinType() |
|
127 | |||
128 | /** |
||
129 | * @param string $joinType |
||
130 | * |
||
131 | * @return $this |
||
132 | */ |
||
133 | 3 | public function setJoinType($joinType) |
|
140 | |||
141 | /** |
||
142 | * @return bool |
||
143 | */ |
||
144 | 20 | public function isRoot() |
|
148 | |||
149 | /** |
||
150 | * @param bool $root |
||
151 | * |
||
152 | * @return $this |
||
153 | */ |
||
154 | 22 | public function setRoot($root) |
|
160 | |||
161 | /** |
||
162 | * @return string |
||
163 | */ |
||
164 | 13 | public function getAliasOrName() |
|
168 | |||
169 | /** |
||
170 | * @param string $clause |
||
171 | * |
||
172 | * @return $this |
||
173 | */ |
||
174 | 5 | public function addSelect($clause) |
|
180 | |||
181 | /** |
||
182 | * @param string $clause |
||
183 | * |
||
184 | * @return $this |
||
185 | */ |
||
186 | 2 | public function joinOn($clause) |
|
192 | |||
193 | /** |
||
194 | * @return string |
||
195 | */ |
||
196 | 3 | public function getJoinOn() |
|
200 | |||
201 | /** |
||
202 | * @param string $name |
||
203 | * |
||
204 | * @return string |
||
205 | */ |
||
206 | 13 | public function column($name) |
|
210 | |||
211 | /** |
||
212 | * @return $this |
||
213 | */ |
||
214 | 1 | public function autoAlias() |
|
220 | } |