I am very new in cakephp and i have to upgrade a cake project from version 1.1 to 3.6. I do not know how to convert these lines of code to cakephp 3.6:
App::import('Model', 'SystemMenu');
$system_menu =& new SystemMenu();
SystemMenu is an model which was define in Model folder.
Thank you very much for your help.
If youre within a controller, you can do
and access the model like so
If not, you can use TableRegistry
And access is simple:
See https://book.cakephp.org/3.0/en/orm/table-objects.html for more information
Notice that i have changed the table name to be plural, as the CakePHP 3.x conventions specifies https://book.cakephp.org/3.0/en/intro/conventions.html