CB 3.5 + var rc = event.getCollection() in handler functions is of no additional benefit now right?

I started with ColdBox after 3.5 so I’m looking / working with a lot of code that sets var rc = event.getCollection() at the beginning of every function.

Aren’t we basically setting this twice now since ColdBox does this for us after 3.5.0?

Are their any benefits or times where you would need to set the rc inside of a handler function?

Thanks for your advice on this.


Actually the rc and prc have been passed as arguments since version 3 I believe. So yes you are correct about it being pointless, just add them to the arguments like

public void function myFunction(event, rc, prc) {}

The only time you would or need to do the var rc = event.getCollection() is in models, interceptors, plugins and services if you need them.

Oops forgot to say, they are only passed as arguments in handlers

Yeah, that is what I though… Thanks Andrew…