Code Duplication    Length = 18-22 lines in 2 locations

lib/stores/modules/mysql_compiler.php 1 location

@@ 37-54 (lines=18) @@
34
				$field=$node["field"];
35
				$record_id=$node["record_id"];
36
				if (!$record_id) {
37
					if ($this->in_orderby && $node["nls"]) {
38
						/*
39
							we do a left join so that we will also find non
40
							matching objects
41
						*/
42
						$objects_table = $this->tbl_prefix."objects";
43
						$aliastable = $table.$node['nls'];
44
						$this->nls_join[$table.$node['nls']] = "left join $table as order_$aliastable on $objects_table.id=order_$aliastable.object and order_$aliastable.AR_nls='".$node["nls"]."' ";
45
						$result = " order_$aliastable.$field ";
46
					} else {
47
						/*
48
							if we are parsing 'orderby' properties we have
49
							to join our tables for the whole query
50
						*/
51
						$this->select_tables[$table]=$table;
52
						$this->used_tables[$table]=$table;
53
						$result=" $table.$field ";
54
					}
55
				} else {
56
					$this->used_tables["$table as $table$record_id"] = $table.$record_id;
57
					if (!$this->in_orderby && !$no_context_join) {

lib/stores/modules/postgresql_compiler.php 1 location

@@ 49-70 (lines=22) @@
46
					if (!$this->in_orderby) {
47
						$result=" $table.object = ".$this->tbl_prefix."objects.id and $table.$field ";
48
						$this->used_tables[$table]=$table;
49
					} else {
50
						if ($this->in_orderby && $node["nls"]) {
51
							/*
52
								we do a left join so that we will also find non
53
								matching objects
54
							*/
55
							$objects_table = $this->tbl_prefix."objects";
56
							$this->nls_join[$table] = "left join $table as order_$table on $objects_table.id=order_$table.object and order_$table.AR_nls='".$node["nls"]."' ";
57
58
							$result = " order_$table.$field ";
59
							$this->select_list["order_".$table.".".$field] = "order_$table.$field";
60
61
						} else {
62
							/*
63
								if we are parsing 'orderby' properties we have
64
								to join our tables for the whole query
65
							*/
66
							$this->select_tables[$table]=$table;
67
							$this->used_tables[$table]=$table;
68
							$result=" $table.$field ";
69
						}
70
					}
71
				} else {
72
					$this->used_tables["$table as $table$record_id"] = $table.$record_id;
73
					if (!$this->in_orderby) {