Code Duplication    Length = 14-14 lines in 2 locations

classes/PodsAPI.php 2 locations

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