Code Duplication    Length = 25-25 lines in 2 locations

classes/Pods.php 2 locations

@@ 2579-2603 (lines=25) @@
2576
					}//end if
2577
2578
					if ( empty( $key ) ) {
2579
						if ( ! in_array( $this->pod_data['type'], array( 'pod', 'table' ), true ) ) {
2580
							if ( isset( $this->pod_data['object_fields'][ $k ] ) ) {
2581
								$key = "`t`.`{$k}`";
2582
							} elseif ( isset( $this->fields[ $k ] ) ) {
2583
								if ( 'table' === $this->pod_data['storage'] ) {
2584
									$key = "`d`.`{$k}`";
2585
								} else {
2586
									$key = "`{$k}`.`meta_value`";
2587
								}
2588
							} else {
2589
								$object_fields = (array) $this->pod_data['object_fields'];
2590
2591
								foreach ( $object_fields as $object_field => $object_field_opt ) {
2592
									if ( $object_field === $k || in_array( $k, $object_field_opt['alias'], true ) ) {
2593
										$key = "`t`.`{$object_field}`";
2594
									}
2595
								}
2596
							}
2597
						} elseif ( isset( $this->fields[ $k ] ) ) {
2598
							if ( 'table' === $this->pod_data['storage'] ) {
2599
								$key = "`t`.`{$k}`";
2600
							} else {
2601
								$key = "`{$k}`.`meta_value`";
2602
							}
2603
						}//end if
2604
2605
						if ( empty( $key ) ) {
2606
							$key = $k;
@@ 2643-2667 (lines=25) @@
2640
2641
					$key = $k;
2642
2643
					if ( ! in_array( $this->pod_data['type'], array( 'pod', 'table' ), true ) ) {
2644
						if ( isset( $this->pod_data['object_fields'][ $k ] ) ) {
2645
							$key = "`t`.`{$k}`";
2646
						} elseif ( isset( $this->fields[ $k ] ) ) {
2647
							if ( 'table' === $this->pod_data['storage'] ) {
2648
								$key = "`d`.`{$k}`";
2649
							} else {
2650
								$key = "`{$k}`.`meta_value`";
2651
							}
2652
						} else {
2653
							$object_fields = (array) $this->pod_data['object_fields'];
2654
2655
							foreach ( $object_fields as $object_field => $object_field_opt ) {
2656
								if ( $object_field === $k || in_array( $k, $object_field_opt['alias'], true ) ) {
2657
									$key = "`t`.`{$object_field}`";
2658
								}
2659
							}
2660
						}
2661
					} elseif ( isset( $this->fields[ $k ] ) ) {
2662
						if ( 'table' === $this->pod_data['storage'] ) {
2663
							$key = "`t`.`{$k}`";
2664
						} else {
2665
							$key = "`{$k}`.`meta_value`";
2666
						}
2667
					}//end if
2668
2669
					$prefix_orderby = "{$key} {$dir}";
2670