PluginProbe ʕ •ᴥ•ʔ
Rank Math SEO – AI SEO Tools to Dominate SEO Rankings / 1.0.255
Rank Math SEO – AI SEO Tools to Dominate SEO Rankings v1.0.255
1.0.273 1.0.272 1.0.271 1.0.271.1 1.0.270 1.0.269 trunk 1.0.216 1.0.217 1.0.218 1.0.219 1.0.220 1.0.221 1.0.222 1.0.223 1.0.224 1.0.225 1.0.226 1.0.227 1.0.227.1 1.0.228 1.0.229 1.0.230 1.0.231 1.0.232 1.0.233 1.0.234 1.0.234.1 1.0.235 1.0.236 1.0.237 1.0.238 1.0.239 1.0.240 1.0.241 1.0.242 1.0.243 1.0.244 1.0.245 1.0.246 1.0.247 1.0.248 1.0.249 1.0.250 1.0.251 1.0.251.1 1.0.252 1.0.252.1 1.0.253 1.0.254 1.0.255 1.0.256 1.0.257 1.0.258 1.0.259 1.0.259.1 1.0.260 1.0.261 1.0.262 1.0.263 1.0.264 1.0.264.1 1.0.265 1.0.266 1.0.266.1 1.0.267 1.0.268
seo-by-rank-math / vendor / mythemeshop / wordpress-helpers / src / database / class-joins.php
seo-by-rank-math / vendor / mythemeshop / wordpress-helpers / src / database Last commit date
class-clauses.php 2 years ago class-database.php 2 years ago class-escape.php 2 years ago class-groupby.php 2 years ago class-joins.php 2 years ago class-orderby.php 2 years ago class-query-builder.php 2 years ago class-select.php 2 years ago class-translate.php 2 years ago class-where.php 2 years ago index.php 2 years ago
class-joins.php
93 lines
1 <?php
2 /**
3 * The joins functions.
4 *
5 * @since 1.0.0
6 * @package MyThemeShop
7 * @subpackage MyThemeShop\Database
8 * @author MyThemeShop <admin@mythemeshop.com>
9 */
10
11 namespace MyThemeShop\Database;
12
13 /**
14 * Joins class.
15 */
16 trait Joins {
17
18 /**
19 * Generate left join clause.
20 *
21 * @param string $table The SQL table.
22 * @param mixed $column1 The SQL Column.
23 * @param mixed $column2 The SQL Column.
24 * @param string $operator The Operator.
25 * @param string $alias The table alias.
26 *
27 * @return self The current query builder.
28 */
29 public function leftJoin( $table, $column1, $column2, $operator = '=', $alias = '' ) { // @codingStandardsIgnoreLine
30 if ( empty( $table ) || empty( $column1 ) || empty( $column2 ) ) {
31 return $this;
32 }
33
34 if ( ! empty( $alias ) ) {
35 $table = "{$table} AS {$alias}";
36 }
37
38 $this->add_sql_clause( 'left_join', "LEFT JOIN {$table} ON {$column1} {$operator} {$column2}" );
39
40 return $this;
41 }
42
43 /**
44 * Generate right join clause.
45 *
46 * @param string $table The SQL table.
47 * @param mixed $column1 The SQL Column.
48 * @param mixed $column2 The SQL Column.
49 * @param string $operator The Operator.
50 * @param string $alias The table alias.
51 *
52 * @return self The current query builder.
53 */
54 public function rightJoin( $table, $column1, $column2, $operator = '=', $alias = '' ) { // @codingStandardsIgnoreLine
55 if ( empty( $table ) || empty( $column1 ) || empty( $column2 ) ) {
56 return $this;
57 }
58
59 if ( ! empty( $alias ) ) {
60 $table = "{$table} AS {$alias}";
61 }
62
63 $this->add_sql_clause( 'right_join', "RIGHT JOIN {$table} ON {$column1} {$operator} {$column2}" );
64
65 return $this;
66 }
67
68 /**
69 * Generate left join clause.
70 *
71 * @param string $table The SQL table.
72 * @param mixed $column1 The SQL Column.
73 * @param mixed $column2 The SQL Column.
74 * @param string $operator The Operator.
75 * @param string $alias The table alias.
76 *
77 * @return self The current query builder.
78 */
79 public function join( $table, $column1, $column2, $operator = '=', $alias = '' ) { // @codingStandardsIgnoreLine
80 if ( empty( $table ) || empty( $column1 ) || empty( $column2 ) ) {
81 return $this;
82 }
83
84 if ( ! empty( $alias ) ) {
85 $table = "{$table} AS {$alias}";
86 }
87
88 $this->add_sql_clause( 'join', "JOIN {$table} ON {$column1} {$operator} {$column2}" );
89
90 return $this;
91 }
92 }
93