Code Duplication    Length = 14-16 lines in 2 locations

classes/PodsAPI.php 2 locations

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