Hi need your help to understand some feature in CakePHP.
I have a SQL Table : user. I generate with bake the Model : UserTable.
In the action home() of my UsersController, i have this :
$t_Results = TableRegistry::get('User')->findByLogin('jdupont')->execute()->fetchAll('assoc');
debug($t_Results);
The query is generated by Cake and this code works well.
My question are :
- Must i create the function findByLogin inside the Model or not ?
- Is my code correct ?
Thanks for the help ;)