So not really a Needs Help question, but it seems like the best category for it.
If you want to elaborate on a get($id) call, you do so by adding an array of parameters as the second argument:
->get($id,[$parameters])
This is pretty different from find call, where you would do it like this:
->find()->contains()->where()…
Is there a logical reason for this inconsistency?
While we’re at it, why is it sometimes you use select(),
and sometimes you use fields()
? And sometimes you use ->where()
and sometimes you use 'conditions'=>
–
On a related note:
It seems like I can never reliably predict how a model name will translate depending on where it’s being used. Most times, it’s plural, sometimes it’s singular. Most times it’s capitalized and camel-cased, but other times it’s lowercase and underscored. And I’m pretty sure there was one occasion where it was first letter lowercase, then camel-cased remainder.