1 | <?php |
||
13 | abstract class AbstractTable implements ExpressionInterface |
||
14 | { |
||
15 | const CROSS_JOIN = 'CROSS JOIN'; |
||
16 | const LEFT_JOIN = 'LEFT JOIN'; |
||
17 | const INNER_JOIN = 'INNER JOIN'; |
||
18 | |||
19 | /** |
||
20 | * @var QueryBuilder $qb |
||
21 | */ |
||
22 | private $qb; |
||
23 | |||
24 | /** |
||
25 | * @var string $tableAlias |
||
26 | */ |
||
27 | private $tableAlias; |
||
28 | |||
29 | /** |
||
30 | * @var string $joinType |
||
31 | */ |
||
32 | private $joinType; |
||
33 | |||
34 | /** |
||
35 | * @var ExpressionInterface $joinOn |
||
36 | */ |
||
37 | private $joinOn = []; |
||
38 | |||
39 | /** |
||
40 | * @var bool $root |
||
41 | */ |
||
42 | private $root = false; |
||
43 | |||
44 | /** |
||
45 | * @var bool $join |
||
46 | */ |
||
47 | private $join = false; |
||
48 | |||
49 | /** |
||
50 | * @param QueryBuilder $qb |
||
51 | */ |
||
52 | 23 | public function __construct(QueryBuilder $qb) |
|
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | abstract public function getTableName(); |
||
61 | |||
62 | /** |
||
63 | * @inheritdoc |
||
64 | */ |
||
65 | 21 | public function compile() |
|
85 | |||
86 | /** |
||
87 | * @return string |
||
88 | */ |
||
89 | 21 | public function getAlias() |
|
93 | |||
94 | /** |
||
95 | * @param string $alias |
||
96 | * |
||
97 | * @return $this |
||
98 | */ |
||
99 | 8 | public function setAlias($alias) |
|
105 | |||
106 | /** |
||
107 | * @return bool |
||
108 | */ |
||
109 | 21 | public function isJoin() |
|
113 | |||
114 | /** |
||
115 | * @return string |
||
116 | */ |
||
117 | 3 | public function getJoinType() |
|
121 | |||
122 | /** |
||
123 | * @param string $joinType |
||
124 | * |
||
125 | * @return $this |
||
126 | */ |
||
127 | 3 | public function setJoinType($joinType) |
|
134 | |||
135 | /** |
||
136 | * @return bool |
||
137 | */ |
||
138 | 21 | public function isRoot() |
|
142 | |||
143 | /** |
||
144 | * @param bool $root |
||
145 | * |
||
146 | * @return $this |
||
147 | */ |
||
148 | 23 | public function setRoot($root) |
|
154 | |||
155 | /** |
||
156 | * @return string |
||
157 | */ |
||
158 | 15 | public function getAliasOrName() |
|
162 | |||
163 | /** |
||
164 | * @param string $clause |
||
165 | * |
||
166 | * @return $this |
||
167 | */ |
||
168 | 5 | public function addSelect($clause) |
|
174 | |||
175 | /** |
||
176 | * @return $this |
||
177 | */ |
||
178 | 2 | public function joinOn() |
|
184 | |||
185 | /** |
||
186 | * @return ExpressionInterface |
||
187 | */ |
||
188 | 21 | public function getJoinOn() |
|
192 | |||
193 | /** |
||
194 | * @param string $name |
||
195 | * |
||
196 | * @return ExprBuilder |
||
197 | */ |
||
198 | 15 | public function column($name) |
|
202 | } |