I have a table activity_logs
What should I give the model name and model file name?
I have created the model file as activityLog.php and model class name as ActivityLog
But I couldn't retrieve the data.
In cake php table names are plural and model names are singular. Table names with underscore are converted into camel case for naming models.
For example user_levels table will have model named as UserLevel:
UserLevel => user_levels
Even if you didn't create a model, Cake will let you use it and make one up on the fly for you, if you follow table names by above naming conventions.
If Cake "ignores" your model, it means it's making up another model on the fly, because you're not using the right name for the model you actually want
Looking at the generated SQL queries in debug = 2 helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With