|
@@ 4602-4615 (lines=14) @@
|
| 4599 |
|
$params->id = $pod[ 'id' ]; |
| 4600 |
|
$params->name = $pod[ 'name' ]; |
| 4601 |
|
|
| 4602 |
|
if ( !pods_tableless() ) { |
| 4603 |
|
if ( 'table' == $pod[ 'storage' ] ) { |
| 4604 |
|
try { |
| 4605 |
|
pods_query( "TRUNCATE `@wp_pods_{$params->name}`", false ); |
| 4606 |
|
} |
| 4607 |
|
catch ( Exception $e ) { |
| 4608 |
|
// Allow pod to be reset if the table doesn't exist |
| 4609 |
|
if ( false === strpos( $e->getMessage(), 'Unknown table' ) ) |
| 4610 |
|
return pods_error( $e->getMessage(), $this ); |
| 4611 |
|
} |
| 4612 |
|
} |
| 4613 |
|
|
| 4614 |
|
pods_query( "DELETE FROM `@wp_podsrel` WHERE `pod_id` = {$params->id} OR `related_pod_id` = {$params->id}", false ); |
| 4615 |
|
} |
| 4616 |
|
|
| 4617 |
|
// @todo Delete relationships from tableless relationships |
| 4618 |
|
|
|
@@ 4755-4768 (lines=14) @@
|
| 4752 |
|
if ( $delete_all ) |
| 4753 |
|
$this->reset_pod( $params, $pod ); |
| 4754 |
|
|
| 4755 |
|
if ( !pods_tableless() ) { |
| 4756 |
|
if ( 'table' == $pod[ 'storage' ] ) { |
| 4757 |
|
try { |
| 4758 |
|
pods_query( "DROP TABLE IF EXISTS `@wp_pods_{$params->name}`", false ); |
| 4759 |
|
} |
| 4760 |
|
catch ( Exception $e ) { |
| 4761 |
|
// Allow pod to be deleted if the table doesn't exist |
| 4762 |
|
if ( false === strpos( $e->getMessage(), 'Unknown table' ) ) |
| 4763 |
|
return pods_error( $e->getMessage(), $this ); |
| 4764 |
|
} |
| 4765 |
|
} |
| 4766 |
|
|
| 4767 |
|
pods_query( "DELETE FROM `@wp_podsrel` WHERE `pod_id` = {$params->id} OR `related_pod_id` = {$params->id}", false ); |
| 4768 |
|
} |
| 4769 |
|
|
| 4770 |
|
// @todo Delete relationships from tableless relationships |
| 4771 |
|
|