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 | * @return QueryBuilder |
||
70 | */ |
||
71 | 1 | public function getQueryBuilder() |
|
75 | |||
76 | /** |
||
77 | * @return string |
||
78 | */ |
||
79 | 20 | public function getAlias() |
|
83 | |||
84 | /** |
||
85 | * @param string $alias |
||
86 | * |
||
87 | * @return $this |
||
88 | */ |
||
89 | 8 | public function setAlias($alias) |
|
95 | |||
96 | /** |
||
97 | * @return bool |
||
98 | */ |
||
99 | 20 | public function isJoin() |
|
103 | |||
104 | /** |
||
105 | * @return string |
||
106 | */ |
||
107 | 3 | public function getJoinType() |
|
111 | |||
112 | /** |
||
113 | * @param string $joinType |
||
114 | * |
||
115 | * @return $this |
||
116 | */ |
||
117 | 3 | public function setJoinType($joinType) |
|
124 | |||
125 | /** |
||
126 | * @return bool |
||
127 | */ |
||
128 | 20 | public function isRoot() |
|
132 | |||
133 | /** |
||
134 | * @param bool $root |
||
135 | * |
||
136 | * @return $this |
||
137 | */ |
||
138 | 22 | public function setRoot($root) |
|
144 | |||
145 | /** |
||
146 | * @return string |
||
147 | */ |
||
148 | 13 | public function getAliasOrName() |
|
152 | |||
153 | /** |
||
154 | * @param string $clause |
||
155 | * |
||
156 | * @return $this |
||
157 | */ |
||
158 | 5 | public function addSelect($clause) |
|
164 | |||
165 | /** |
||
166 | * @param string $clause |
||
167 | * |
||
168 | * @return $this |
||
169 | */ |
||
170 | 2 | public function joinOn($clause) |
|
176 | |||
177 | /** |
||
178 | * @return string |
||
179 | */ |
||
180 | 20 | public function getJoinOn() |
|
184 | |||
185 | /** |
||
186 | * @param string $name |
||
187 | * |
||
188 | * @return string |
||
189 | */ |
||
190 | 13 | public function column($name) |
|
194 | } |