This feels like it falls under silly/obvious questions, but I can't seem to find a decent answer anywhere, so I'm asking here:
How do I find out which methods for example, is available on an object? For example, I'm able to do {{ entry.authors.one() }}
and get the first one in the object. Great, but if I didn't kow that one()
existed, how would I find out? Now, in regular ol' PHP I'd var_dump($authors)
or whatever, and whatever the object contained would be displayed, including methods. Doing the same in a twig template by either using {{ dump(entry.authors() }}
or {{ dd(entry.authors() }}
shows the object (I think?) but not the methods I'm able to use on it. In fact, it seems impossible to just look up what specific methods I'm able to use on a specific object. I'm sure that I'm just missing something though.
So how can I find out what I'm able to do with said object? Surely there must be a better way to know other than "you'll have to guess" or rely on abstract documentation which might not be relevant to a specific use case?
I realize the above example is incredibly simple, but obviously there are more complex situations that arise. Like when I'm digging down into multiple nested fields, looping through their children() etc, it's quite easy to get "lost", as it were.