1 | <?php |
||
5 | trait JoinTrait |
||
6 | { |
||
7 | /** |
||
8 | * Define the sql prefix to use for each join object |
||
9 | * |
||
10 | * @return void |
||
11 | */ |
||
12 | protected function joinDefinePrefix() |
||
18 | |||
19 | /** |
||
20 | * Add a INNER JOIN to the request |
||
21 | * |
||
22 | * @return $this |
||
23 | */ |
||
24 | public function join(...$args): self |
||
29 | |||
30 | /** |
||
31 | * Add a LEFT JOIN to the request |
||
32 | * |
||
33 | * @return $this |
||
34 | */ |
||
35 | public function joinLeft(...$args): self |
||
40 | |||
41 | /** |
||
42 | * Add a RIGHT JOIN to the request |
||
43 | * |
||
44 | * @return $this |
||
45 | */ |
||
46 | public function joinRight(...$args): self |
||
51 | |||
52 | /** |
||
53 | * Add a (inner|left|right) join to the request |
||
54 | * |
||
55 | * @param string $joinType The name of the property in this class |
||
56 | * where the join is add |
||
57 | * @param string|array $table Name of the table concerned by |
||
58 | * the join. Or an array with the table shortcut in key. |
||
59 | * @param string $on SQL part "ON" for this join |
||
60 | * @param string|array $columns Columns from the table joined to add in |
||
61 | * the SELECT part of the request |
||
62 | * |
||
63 | * @return $this |
||
64 | */ |
||
65 | protected function createJoin( |
||
75 | } |
||
76 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: