Method to use cakephp 2 style singular model names in Aros table?
I am porting from CakePHP 2 to 3 and have noticed that the names in the 'model' field of the Aros table should now be plural (i.e. 'Group' is now 'Groups' and 'User' is now 'Users'). Is there a way to force the plugin to look for the singular form of the model name so that the database is not changed? Thanks.
The name is based on the model/table class name. CakePHP 3 has changed the convention so that tables are the plural form now.
It is recommended to migrate from CakePHP 2.x to 3.x using a staged process (CakeFest 2017, '3.4 and the Path to 4.0.0 - Mark Story @mark_story', https://www.youtube.com/watch?v=DtH__Iz9Mjs, answer to question after 44m:15s into the video to 46m:30s). If sharing the same underlying database between a 2.x application which uses ACL and a partially upgraded 3.x version which using this plugin, how might one go about adapting the plugin, perhaps using Inflector::pluralize($aros.model), so that the plugin works on the 2.x aros table?
Would a good place to start be by altering how the model field in the ArosTable.php file is read? How might one do that to change it into plural form?
Are there likely to be any other places which need changing if it is changed via the ArosTable.php file? A search on 'model' (case insensitive) in the source code shows that most of the fixtures and test cases use the singular values User and Group, and so don't appear to have been updated for CakePHP 3.x yet. BaseAuthorize.php sets 'userModel' => 'Users', so is not using a value from the table.