diff options
author | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-25 21:08:24 -0500 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-25 21:45:47 -0500 |
commit | 1069d54c85149ff1cb51563d6a1fc471695f8b47 (patch) | |
tree | e5c22762ef4d6c90dcdb3646a04de26e21ad071c /lib/class/flag.class.php | |
parent | cad1380737f7ffcfa82d46ab3066823435a48a5d (diff) | |
download | ampache-1069d54c85149ff1cb51563d6a1fc471695f8b47.tar.gz ampache-1069d54c85149ff1cb51563d6a1fc471695f8b47.tar.bz2 ampache-1069d54c85149ff1cb51563d6a1fc471695f8b47.zip |
Move clean functions into their respective classes
Uniformly name them gc()
Diffstat (limited to 'lib/class/flag.class.php')
-rw-r--r-- | lib/class/flag.class.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/class/flag.class.php b/lib/class/flag.class.php index 65789686..ed1fef06 100644 --- a/lib/class/flag.class.php +++ b/lib/class/flag.class.php @@ -59,6 +59,15 @@ class Flag extends database_object { } // Constructor /** + * gc + * + * This cleans out unused flagged items + */ + public static function gc() { + Dba::write("DELETE FROM `flagged` USING `flagged` LEFT JOIN `song` ON `song`.`id` = `flagged`.`object_id` WHERE `song`.`id` IS NULL AND `object_type` = 'song'"); + } + + /** * build_cache * This takes an array of ids and builds up a nice little cache * for us |