1
0
Fork 0
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:
Paul Arthur 2013-01-25 21:08:24 -05:00
parent cad1380737
commit 1069d54c85
17 changed files with 142 additions and 196 deletions

View file

@ -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