|
@@ 4694-4707 (lines=14) @@
|
| 4691 |
|
$params->id = $pod[ 'id' ]; |
| 4692 |
|
$params->name = $pod[ 'name' ]; |
| 4693 |
|
|
| 4694 |
|
if ( !pods_tableless() ) { |
| 4695 |
|
if ( 'table' == $pod[ 'storage' ] ) { |
| 4696 |
|
try { |
| 4697 |
|
pods_query( "TRUNCATE `@wp_pods_{$params->name}`", false ); |
| 4698 |
|
} |
| 4699 |
|
catch ( Exception $e ) { |
| 4700 |
|
// Allow pod to be reset if the table doesn't exist |
| 4701 |
|
if ( false === strpos( $e->getMessage(), 'Unknown table' ) ) |
| 4702 |
|
return pods_error( $e->getMessage(), $this ); |
| 4703 |
|
} |
| 4704 |
|
} |
| 4705 |
|
|
| 4706 |
|
pods_query( "DELETE FROM `@wp_podsrel` WHERE `pod_id` = {$params->id} OR `related_pod_id` = {$params->id}", false ); |
| 4707 |
|
} |
| 4708 |
|
|
| 4709 |
|
// @todo Delete relationships from tableless relationships |
| 4710 |
|
|
|
@@ 4847-4860 (lines=14) @@
|
| 4844 |
|
if ( $delete_all ) |
| 4845 |
|
$this->reset_pod( $params, $pod ); |
| 4846 |
|
|
| 4847 |
|
if ( !pods_tableless() ) { |
| 4848 |
|
if ( 'table' == $pod[ 'storage' ] ) { |
| 4849 |
|
try { |
| 4850 |
|
pods_query( "DROP TABLE IF EXISTS `@wp_pods_{$params->name}`", false ); |
| 4851 |
|
} |
| 4852 |
|
catch ( Exception $e ) { |
| 4853 |
|
// Allow pod to be deleted if the table doesn't exist |
| 4854 |
|
if ( false === strpos( $e->getMessage(), 'Unknown table' ) ) |
| 4855 |
|
return pods_error( $e->getMessage(), $this ); |
| 4856 |
|
} |
| 4857 |
|
} |
| 4858 |
|
|
| 4859 |
|
pods_query( "DELETE FROM `@wp_podsrel` WHERE `pod_id` = {$params->id} OR `related_pod_id` = {$params->id}", false ); |
| 4860 |
|
} |
| 4861 |
|
|
| 4862 |
|
// @todo Delete relationships from tableless relationships |
| 4863 |
|
|