Hi,
Yay I exposed a bug :D
As far as your question:
Well the underlying model on my case example was NewsPages hasMany newsTags and they belong to many pages.
The implementation of my line of code was that I had a sitetree extension to create a "loose relation" that sets up a comma separated field of ID:s of tags, so on those pages i dont have a $newsPageObject per ce.
Anyways the issue was that out the fastest way filter out the pages that would relate to tags defined on that Page e.g. "a list of related news". Choices were to create nested loops, or do a joins manually and then I remembered valugelly at some point the docs or something referred to the dot on filering relations.
But I just couldn't find a definite sample on the docs and in my opinion that I't ease up the pain on writing joins is quite good to have as an example there :).
Everything else is there but its missing something that you can google or ctrl-f with "filterin by relations" or "filter by has many" or similar.
Two simple samples should do it:
"get pages that have a tag that starts with the string" or using the player idea thats there.. get teams that have players with first name or team(s) (would of course be the one) with the player id or an id list to get many teams. :)
Actually.. need to go to bed but was looking at this:
array(1,2,3));
Doesn't that filter tags 1,2,3 from the tags that have tagged FOR that page. On the case example i'm interested on NewsPages that are tagged with tags 1,2,3
Eg
NewsPage::get()->filter('NewsTags.ID',array(1,2,3));
or
Datalist::create("NewsPage")->filter('NewsTags.ID', array(1,2,3));
Cheers,
Olli