1 | <?php |
||
31 | trait JoinTrait |
||
32 | { |
||
33 | /** |
||
34 | * {@inheritDoc} |
||
35 | */ |
||
36 | public function join($secondTable, $onClause = '', $firstTable = '') |
||
40 | |||
41 | /** |
||
42 | * {@inheritDoc} |
||
43 | */ |
||
44 | public function leftJoin($secondTable, $onClause = '', $firstTable = '') |
||
48 | |||
49 | /** |
||
50 | * {@inheritDoc} |
||
51 | */ |
||
52 | public function joinRaw(/*# string */ $joinType, /*# string */ $rawString) |
||
56 | |||
57 | /** |
||
58 | * The real join |
||
59 | * |
||
60 | * @param string $joinType |
||
61 | * @param string|string[]|SelectStatementInterface $secondTable |
||
62 | * @param string|string[]|ExpressionInterface $onClause |
||
63 | * @param string $firstTable |
||
64 | * @param bool $rawMode |
||
65 | * @return $this |
||
66 | * @access protected |
||
67 | */ |
||
68 | protected function realJoin( |
||
87 | |||
88 | /** |
||
89 | * Fix join table |
||
90 | * |
||
91 | * @param string|string[]|SelectStatementInterface $table |
||
92 | * @return array [table, alias] |
||
93 | * @access protected |
||
94 | */ |
||
95 | protected function fixJoinTable($table) |
||
105 | |||
106 | /** |
||
107 | * Fix 'ON' clause |
||
108 | * |
||
109 | * @param mixed $onClause |
||
110 | * @return array|ExpressionInterface |
||
111 | * @access protected |
||
112 | */ |
||
113 | protected function fixOnClause($onClause) |
||
123 | |||
124 | /** |
||
125 | * Build join |
||
126 | * |
||
127 | * @param string $prefix |
||
128 | * @param array $settings |
||
129 | * @return string |
||
130 | * @access protected |
||
131 | */ |
||
132 | protected function buildJoin( |
||
151 | |||
152 | /** |
||
153 | * Build TABLE part |
||
154 | * |
||
155 | * @param array $cls |
||
156 | * @param array $settings |
||
157 | * @return string |
||
158 | * @access protected |
||
159 | */ |
||
160 | protected function buildJoinTable(array $cls, array $settings)/*# : string */ |
||
166 | |||
167 | /** |
||
168 | * Build ON part |
||
169 | * |
||
170 | * @param array $cls |
||
171 | * @param array $settings |
||
172 | * @return string |
||
173 | * @access protected |
||
174 | */ |
||
175 | protected function buildJoinOn(array $cls, array $settings)/*# : string */ |
||
192 | |||
193 | /** |
||
194 | * Get first table alias |
||
195 | * |
||
196 | * @param array $cls |
||
197 | * @return string |
||
198 | * @access protected |
||
199 | */ |
||
200 | protected function getFirstTableAlias(array $cls)/*# : string */ |
||
212 | |||
213 | /** |
||
214 | * Get second table alias |
||
215 | * |
||
216 | * @param array $cls |
||
217 | * @return string |
||
218 | * @access protected |
||
219 | */ |
||
220 | protected function getSecondTableAlias(array $cls)/*# : string */ |
||
228 | |||
229 | abstract protected function quote(/*# string */ $str, array $settings)/*# : string */; |
||
245 | } |
||
246 |