diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-26 16:42:35 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-26 16:42:35 +0100 |
| commit | b458e321c3361bee831ba7c0c01f21802f8336fa (patch) | |
| tree | 2b17f8b6322b3da126de16c48c7509e25ea36094 /import | |
| parent | 3daafdff26393a8f6ffe8c6b9eccbbdb31eacc5e (diff) | |
| download | stock-b458e321c3361bee831ba7c0c01f21802f8336fa.tar.gz stock-b458e321c3361bee831ba7c0c01f21802f8336fa.tar.bz2 stock-b458e321c3361bee831ba7c0c01f21802f8336fa.zip | |
Simplify expunge helper — delegate to StockAssembly::expunge()
Now that LibertyContent::expunge() handles liberty_xref, setting
mContentId and calling expunge() is sufficient. StockAssembly::expunge()
covers component_map and stock_assembly; LibertyContent::expunge()
covers the rest.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'import')
| -rw-r--r-- | import/ImportSimpleAssembly.php | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/import/ImportSimpleAssembly.php b/import/ImportSimpleAssembly.php index 860eeaf..325a484 100644 --- a/import/ImportSimpleAssembly.php +++ b/import/ImportSimpleAssembly.php @@ -32,14 +32,11 @@ function stockExpungeAssemblyByTitle( string $title ): bool { return false; } - $gBitDb->query( "DELETE FROM `".BIT_DB_PREFIX."liberty_xref` WHERE `content_id` = ?", [ $contentId ] ); - $gBitDb->query( "DELETE FROM `".BIT_DB_PREFIX."stock_assembly_component_map` WHERE `assembly_content_id` = ?", [ $contentId ] ); - $gBitDb->query( "DELETE FROM `".BIT_DB_PREFIX."stock_assembly_component_map` WHERE `item_content_id` = ?", [ $contentId ] ); - $gBitDb->query( "DELETE FROM `".BIT_DB_PREFIX."stock_assembly` WHERE `content_id` = ?", [ $contentId ] ); - $gBitDb->query( "DELETE FROM `".BIT_DB_PREFIX."liberty_content_hits` WHERE `content_id` = ?", [ $contentId ] ); - $gBitDb->query( "DELETE FROM `".BIT_DB_PREFIX."liberty_content_prefs` WHERE `content_id` = ?", [ $contentId ] ); - $gBitDb->query( "DELETE FROM `".BIT_DB_PREFIX."liberty_content_data` WHERE `content_id` = ?", [ $contentId ] ); - $gBitDb->query( "DELETE FROM `".BIT_DB_PREFIX."liberty_content` WHERE `content_id` = ?", [ $contentId ] ); + // StockAssembly::expunge() cleans component_map + stock_assembly, + // then calls LibertyContent::expunge() which now handles liberty_xref + liberty_content + $assembly = new StockAssembly(); + $assembly->mContentId = (int)$contentId; + $assembly->expunge(); return true; } |
