Code Duplication    Length = 14-16 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 2713-2728 (lines=16) @@
2710
                }
2711
            }
2712
        }
2713
        elseif ( 0 < $sister_id ) {
2714
            update_post_meta( $sister_id, 'sister_id', $params->id );
2715
2716
            if ( true === $db && ( !pods_tableless() ) ) {
2717
                pods_query( "
2718
                        UPDATE `@wp_podsrel`
2719
                        SET `related_field_id` = %d
2720
                        WHERE `field_id` = %d
2721
                    ",
2722
                    array(
2723
                        $params->id,
2724
                        $sister_id
2725
                    )
2726
                );
2727
            }
2728
        }
2729
        elseif ( 0 < $old_sister_id ) {
2730
            delete_post_meta( $old_sister_id, 'sister_id' );
2731
@@ 2729-2742 (lines=14) @@
2726
                );
2727
            }
2728
        }
2729
        elseif ( 0 < $old_sister_id ) {
2730
            delete_post_meta( $old_sister_id, 'sister_id' );
2731
2732
            if ( true === $db && ( !pods_tableless() ) ) {
2733
                pods_query( "
2734
                        UPDATE `@wp_podsrel`
2735
                        SET `related_field_id` = 0
2736
                        WHERE `field_id` = %d
2737
                    ", array(
2738
                        $old_sister_id
2739
                    )
2740
                );
2741
            }
2742
        }
2743
2744
        if ( !empty( $old_id ) && $old_name != $field[ 'name' ] && true === $db ) {
2745
            pods_query( "