@@ 4554-4567 (lines=14) @@ | ||
4551 | $params->id = $pod[ 'id' ]; |
|
4552 | $params->name = $pod[ 'name' ]; |
|
4553 | ||
4554 | if ( !pods_tableless() ) { |
|
4555 | if ( 'table' == $pod[ 'storage' ] ) { |
|
4556 | try { |
|
4557 | pods_query( "TRUNCATE `@wp_pods_{$params->name}`", false ); |
|
4558 | } |
|
4559 | catch ( Exception $e ) { |
|
4560 | // Allow pod to be reset if the table doesn't exist |
|
4561 | if ( false === strpos( $e->getMessage(), 'Unknown table' ) ) |
|
4562 | return pods_error( $e->getMessage(), $this ); |
|
4563 | } |
|
4564 | } |
|
4565 | ||
4566 | pods_query( "DELETE FROM `@wp_podsrel` WHERE `pod_id` = {$params->id} OR `related_pod_id` = {$params->id}", false ); |
|
4567 | } |
|
4568 | ||
4569 | // @todo Delete relationships from tableless relationships |
|
4570 | ||
@@ 4707-4720 (lines=14) @@ | ||
4704 | if ( $delete_all ) |
|
4705 | $this->reset_pod( $params, $pod ); |
|
4706 | ||
4707 | if ( !pods_tableless() ) { |
|
4708 | if ( 'table' == $pod[ 'storage' ] ) { |
|
4709 | try { |
|
4710 | pods_query( "DROP TABLE IF EXISTS `@wp_pods_{$params->name}`", false ); |
|
4711 | } |
|
4712 | catch ( Exception $e ) { |
|
4713 | // Allow pod to be deleted if the table doesn't exist |
|
4714 | if ( false === strpos( $e->getMessage(), 'Unknown table' ) ) |
|
4715 | return pods_error( $e->getMessage(), $this ); |
|
4716 | } |
|
4717 | } |
|
4718 | ||
4719 | pods_query( "DELETE FROM `@wp_podsrel` WHERE `pod_id` = {$params->id} OR `related_pod_id` = {$params->id}", false ); |
|
4720 | } |
|
4721 | ||
4722 | // @todo Delete relationships from tableless relationships |
|
4723 |