Code Duplication    Length = 14-14 lines in 2 locations

classes/PodsAPI.php 2 locations

@@ 4560-4573 (lines=14) @@
4557
        $params->id = $pod[ 'id' ];
4558
        $params->name = $pod[ 'name' ];
4559
4560
        if ( !pods_tableless() ) {
4561
            if ( 'table' == $pod[ 'storage' ] ) {
4562
                try {
4563
                    pods_query( "TRUNCATE `@wp_pods_{$params->name}`", false );
4564
                }
4565
                catch ( Exception $e ) {
4566
                    // Allow pod to be reset if the table doesn't exist
4567
                    if ( false === strpos( $e->getMessage(), 'Unknown table' ) )
4568
                        return pods_error( $e->getMessage(), $this );
4569
                }
4570
            }
4571
4572
            pods_query( "DELETE FROM `@wp_podsrel` WHERE `pod_id` = {$params->id} OR `related_pod_id` = {$params->id}", false );
4573
        }
4574
4575
        // @todo Delete relationships from tableless relationships
4576
@@ 4713-4726 (lines=14) @@
4710
        if ( $delete_all )
4711
            $this->reset_pod( $params, $pod );
4712
4713
        if ( !pods_tableless() ) {
4714
            if ( 'table' == $pod[ 'storage' ] ) {
4715
                try {
4716
                    pods_query( "DROP TABLE IF EXISTS `@wp_pods_{$params->name}`", false );
4717
                }
4718
                catch ( Exception $e ) {
4719
                    // Allow pod to be deleted if the table doesn't exist
4720
                    if ( false === strpos( $e->getMessage(), 'Unknown table' ) )
4721
                        return pods_error( $e->getMessage(), $this );
4722
                }
4723
            }
4724
4725
            pods_query( "DELETE FROM `@wp_podsrel` WHERE `pod_id` = {$params->id} OR `related_pod_id` = {$params->id}", false );
4726
        }
4727
4728
        // @todo Delete relationships from tableless relationships
4729