mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-05 19:41:55 +02:00
Move clean functions into their respective classes
Uniformly name them gc()
This commit is contained in:
parent
cad1380737
commit
1069d54c85
17 changed files with 142 additions and 196 deletions
|
@ -59,6 +59,17 @@ class shoutBox {
|
|||
|
||||
} // _get_info
|
||||
|
||||
/**
|
||||
* gc
|
||||
*
|
||||
* Cleans out orphaned shoutbox items
|
||||
*/
|
||||
public static function gc() {
|
||||
foreach(array('song', 'album', 'artist') as $object_type) {
|
||||
Dba::write("DELETE FROM `user_shout` USING `user_shout` LEFT JOIN `$object_type` ON `$object_type`.`id` = `user_shout`.`object_id` WHERE `$object_type`.`id` IS NULL AND `user_shout`.`object_type` = '$object_type'");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get_top
|
||||
* This returns the top user_shouts, shoutbox objects are always shown regardless and count against the total
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue