Code Duplication    Length = 14-14 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 4468-4481 (lines=14) @@
4465
        $params->id = $pod[ 'id' ];
4466
        $params->name = $pod[ 'name' ];
4467
4468
        if ( !pods_tableless() ) {
4469
            if ( 'table' == $pod[ 'storage' ] ) {
4470
                try {
4471
                    pods_query( "TRUNCATE `@wp_pods_{$params->name}`", false );
4472
                }
4473
                catch ( Exception $e ) {
4474
                    // Allow pod to be reset if the table doesn't exist
4475
                    if ( false === strpos( $e->getMessage(), 'Unknown table' ) )
4476
                        return pods_error( $e->getMessage(), $this );
4477
                }
4478
            }
4479
4480
            pods_query( "DELETE FROM `@wp_podsrel` WHERE `pod_id` = {$params->id} OR `related_pod_id` = {$params->id}", false );
4481
        }
4482
4483
        // @todo Delete relationships from tableless relationships
4484
@@ 4621-4634 (lines=14) @@
4618
        if ( $delete_all )
4619
            $this->reset_pod( $params, $pod );
4620
4621
        if ( !pods_tableless() ) {
4622
            if ( 'table' == $pod[ 'storage' ] ) {
4623
                try {
4624
                    pods_query( "DROP TABLE IF EXISTS `@wp_pods_{$params->name}`", false );
4625
                }
4626
                catch ( Exception $e ) {
4627
                    // Allow pod to be deleted if the table doesn't exist
4628
                    if ( false === strpos( $e->getMessage(), 'Unknown table' ) )
4629
                        return pods_error( $e->getMessage(), $this );
4630
                }
4631
            }
4632
4633
            pods_query( "DELETE FROM `@wp_podsrel` WHERE `pod_id` = {$params->id} OR `related_pod_id` = {$params->id}", false );
4634
        }
4635
4636
        // @todo Delete relationships from tableless relationships
4637