Code Duplication    Length = 14-16 lines in 2 locations

classes/PodsAPI.php 2 locations

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