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 | 21 | public function __construct(QueryBuilder $qb) |
|
54 | |||
55 | /** |
||
56 | * @return ReferenceManager |
||
57 | */ |
||
58 | 12 | public function __toString() |
|
62 | |||
63 | /** |
||
64 | * @return string |
||
65 | */ |
||
66 | abstract public function getTableName(); |
||
67 | |||
68 | /** |
||
69 | * @return string |
||
70 | */ |
||
71 | 19 | public function getAlias() |
|
75 | |||
76 | /** |
||
77 | * @param string $alias |
||
78 | * |
||
79 | * @return $this |
||
80 | */ |
||
81 | 8 | public function setAlias($alias) |
|
87 | |||
88 | /** |
||
89 | * @return bool |
||
90 | */ |
||
91 | 19 | public function isJoin() |
|
95 | |||
96 | /** |
||
97 | * @return string |
||
98 | */ |
||
99 | 3 | public function getJoinType() |
|
103 | |||
104 | /** |
||
105 | * @param string $joinType |
||
106 | * |
||
107 | * @return $this |
||
108 | */ |
||
109 | 3 | public function setJoinType($joinType) |
|
116 | |||
117 | /** |
||
118 | * @return bool |
||
119 | */ |
||
120 | 19 | public function isRoot() |
|
124 | |||
125 | /** |
||
126 | * @param bool $root |
||
127 | * |
||
128 | * @return $this |
||
129 | */ |
||
130 | 21 | public function setRoot($root) |
|
136 | |||
137 | /** |
||
138 | * @return string |
||
139 | */ |
||
140 | 12 | public function getAliasOrName() |
|
144 | |||
145 | /** |
||
146 | * @param string $clause |
||
147 | * |
||
148 | * @return $this |
||
149 | */ |
||
150 | 5 | public function addSelect($clause) |
|
156 | |||
157 | /** |
||
158 | * @param string $clause |
||
159 | * |
||
160 | * @return $this |
||
161 | */ |
||
162 | 2 | public function joinOn($clause) |
|
168 | |||
169 | /** |
||
170 | * @return string |
||
171 | */ |
||
172 | 19 | public function getJoinOn() |
|
176 | |||
177 | /** |
||
178 | * @param string $name |
||
179 | * |
||
180 | * @return string |
||
181 | */ |
||
182 | 12 | public function column($name) |
|
186 | } |