Where are the docs for Collection->filter()?

I noticed that $site->someField()->toStructure() returns an instance of Structure that extends Collection and therefore has the method filter(). However, I can’t find any documentation regarding usage. There are no docs for the Structure class and no docs for Collection either. Can’t find them in the docs sidebar, the docs search bar, in Google…

This seems to be the source code:

But it doesn’t tell much either.

That is indeed missing. It’s asically the same as for pages: https://getkirby.com/docs/reference/objects/pages/filter

1 Like

I’ve noticed similar missing docs before. Perhaps the docs page should have all classes and their methods and link any methods they have extended. For example, Collection->filter() links to $pages->filter(). Would save a lot of time!

I already created an issue: https://github.com/getkirby/getkirby.com/issues/447

If you find anything missing, don’t hesitate to create an issue on GitHub in that repo.

1 Like