Code Duplication    Length = 14-14 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 4635-4648 (lines=14) @@
4632
        $params->id = $pod[ 'id' ];
4633
        $params->name = $pod[ 'name' ];
4634
4635
        if ( !pods_tableless() ) {
4636
            if ( 'table' == $pod[ 'storage' ] ) {
4637
                try {
4638
                    pods_query( "TRUNCATE `@wp_pods_{$params->name}`", false );
4639
                }
4640
                catch ( Exception $e ) {
4641
                    // Allow pod to be reset if the table doesn't exist
4642
                    if ( false === strpos( $e->getMessage(), 'Unknown table' ) )
4643
                        return pods_error( $e->getMessage(), $this );
4644
                }
4645
            }
4646
4647
            pods_query( "DELETE FROM `@wp_podsrel` WHERE `pod_id` = {$params->id} OR `related_pod_id` = {$params->id}", false );
4648
        }
4649
4650
        // @todo Delete relationships from tableless relationships
4651
@@ 4788-4801 (lines=14) @@
4785
        if ( $delete_all )
4786
            $this->reset_pod( $params, $pod );
4787
4788
        if ( !pods_tableless() ) {
4789
            if ( 'table' == $pod[ 'storage' ] ) {
4790
                try {
4791
                    pods_query( "DROP TABLE IF EXISTS `@wp_pods_{$params->name}`", false );
4792
                }
4793
                catch ( Exception $e ) {
4794
                    // Allow pod to be deleted if the table doesn't exist
4795
                    if ( false === strpos( $e->getMessage(), 'Unknown table' ) )
4796
                        return pods_error( $e->getMessage(), $this );
4797
                }
4798
            }
4799
4800
            pods_query( "DELETE FROM `@wp_podsrel` WHERE `pod_id` = {$params->id} OR `related_pod_id` = {$params->id}", false );
4801
        }
4802
4803
        // @todo Delete relationships from tableless relationships
4804