Tagger
Tagger copied to clipboard
Extract getTags to own method
I recently had need to get the tags attached to resources, to output in XML and JSON. I did not find a way to get the raw results from the snippet, so wrote my own database query.
This small refactoring extracts the queries into a method, so they can be called on their own and the raw tag objects returned.
There is a design flaw: the count/total values are tightly coupled to the query, and I have retained them inside the method. This required a new object to be returned, rather than the raw TaggerTag iterator which I was aiming for. Right now, I have no better alternative.