So, I would like to use this magic find function in my CakePHP 2.0 app:
$profile = $this->Profile->findByUserId($user['User']['id']);
However, the field in question is called userId, not user_id. The code above throws an error – column user_id is missing.
Is there a way to force Cake to try to look for camel cased column names?
Thanks for reading!
You will have to override the appropriate function for that. Cake’s conventions are just that, conventions. If you stray from them, you’ll need to put in more manual work. So either create the function
findByUserIdin the appropriate model, or override the magic__callfunction.