Why is get() syntax different than find()?

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:


This is pretty different from find call, where you would do it like this:


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.

Well, get($id) is basically just a wrapper for:

$this->Model->find()->where(['Model.id' => $id])->first()

So it’s not so much an inconsistency, but rather a helper.

As for the different find syntaxes, I’m not sure if there’s a good reason for it. But both have some slight advantages / disadvantages over one another, hence why the devs probably didn’t want to eliminate one.

Not sure what you mean by how a model is translated, do you mean inflection? I guess it’s a little confusing because entities are singular and tables plural, but I can’t remember any time when lower-case camel case was being used…