Code Duplication    Length = 14-16 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 2699-2714 (lines=16) @@
2696
                }
2697
            }
2698
        }
2699
        elseif ( 0 < $sister_id ) {
2700
            update_post_meta( $sister_id, 'sister_id', $params->id );
2701
2702
            if ( true === $db && ( !pods_tableless() ) ) {
2703
                pods_query( "
2704
                        UPDATE `@wp_podsrel`
2705
                        SET `related_field_id` = %d
2706
                        WHERE `field_id` = %d
2707
                    ",
2708
                    array(
2709
                        $params->id,
2710
                        $sister_id
2711
                    )
2712
                );
2713
            }
2714
        }
2715
        elseif ( 0 < $old_sister_id ) {
2716
            delete_post_meta( $old_sister_id, 'sister_id' );
2717
@@ 2715-2728 (lines=14) @@
2712
                );
2713
            }
2714
        }
2715
        elseif ( 0 < $old_sister_id ) {
2716
            delete_post_meta( $old_sister_id, 'sister_id' );
2717
2718
            if ( true === $db && ( !pods_tableless() ) ) {
2719
                pods_query( "
2720
                        UPDATE `@wp_podsrel`
2721
                        SET `related_field_id` = 0
2722
                        WHERE `field_id` = %d
2723
                    ", array(
2724
                        $old_sister_id
2725
                    )
2726
                );
2727
            }
2728
        }
2729
2730
        if ( !empty( $old_id ) && $old_name != $field[ 'name' ] && true === $db ) {
2731
            pods_query( "