I'm creating a simple tag system that allows me to link a tag to almost everything in my application. In order to facilitate this, I created a table called "objects", referenced by my model "Object".
I've got three models setup at the moment:
- Tag (with TagObject defined as a dependentTable)
- Object (with TagObject defined as a dependedTable)
- TagObject (with both Tag and Object defined in the referenceMap)
I already created some simple methods like fetchTagById()
and fetchTagByName()
in my Tag model, but now I want to create a method that gets my tags and their respective occurences in the objects table, in order to create a simple tag cloud.
Structure-wise, what is the best location to create this method (using findDependentRowset())?
I somehow feel it is not very good practise to store this in my Tag model, but storing it in my TagObject model seems awkward too, and might overcomplicate things.
Any advice would be greatly appreciated.
Thanks in advance.