Seems like creating an association that uses a custom finder might be the way to go? Never tried, so I can’t provide sample code; give it a shot and see how it works?
Another option would be to have multiple associations, and a virtual field with a custom _get function that combines them all?
Another option could be to not treat the tags as entity itself, but use a TagBehavior and a TagTrait (for controllers) to simply use/include it into any model/controller…
This way, you could have a tags-column on any entity to store the tags and can provide common search/add/edit/delete functions to models and controllers with minimum effort.
Apologies about reviving an old thread. Just ignore.
I chose to do so, however, because the solution to this question is now documented in the other thread I recently created, I figured as an aid anyone doing searches on how to do this, I should post a link to the other thread here: