diff options
Diffstat (limited to 'lib/Bookmarks/M/DB/Tags.pm')
-rw-r--r-- | lib/Bookmarks/M/DB/Tags.pm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/Bookmarks/M/DB/Tags.pm b/lib/Bookmarks/M/DB/Tags.pm index 3686a7d..cc675f7 100644 --- a/lib/Bookmarks/M/DB/Tags.pm +++ b/lib/Bookmarks/M/DB/Tags.pm @@ -22,7 +22,7 @@ GROUP BY links_tags.tag ORDER BY how_many DESC END_SQL -__PACKAGE__->columns(TEMP=> 'how_wany'); +__PACKAGE__->columns(TEMP=> 'how_many'); sub count_links { my ($self)=@_; @@ -52,6 +52,18 @@ sub ordered_links { return sort links_sorter @links; } +sub cleanup { + my ($class)=@_; + + my @tag_list=reverse $class->search_popularity(); + + while ($tag_list[0]->how_many() == 0) { + (shift @tag_list)->delete(); + } + + return; +} + =head1 NAME Bookmarks::M::DB::Tags - CDBI Model Component Table Class |