mitchellvanw / laravel-doctrine

NO LONGER MAINTAINED! A Doctrine 2 implementation that melts with Laravel
MIT License
187 stars 74 forks source link

Added Laravel naming strategy #74

Closed guiwoda closed 9 years ago

guiwoda commented 9 years ago

The laravel convention goes something like this:

Given a User, Group and RealBusiness schema:

users, groups and real_businesses for table names (pluralized snaked form.) users.id, groups.id for ids (id as identifier convention.) user_group for belongsToMany association tables (singular snaked concat of table names.) $realBusiness->user for belongsTo associations (singular camel case of entity name.) $user->realBusinesses for hasMany and belongsToMany associations (plural camel case of entity name.)

Using Illuminate\Support\Str To convert between singular / plural / camel / snake forms, so it should behave exactly as Laravel.

kirkbushell commented 9 years ago

hi @guiwoda

This is a great feature and I think is a necessary requirement to ensure the package fits well with Laravel conventions. However, there are no tests surrounding this PR. If you could, please update from master, and the required tests for this feature.

Thanks.

guiwoda commented 9 years ago

@kirkbushell there! rebased master and done some tests. Let me know if you need something else! :smile:

kirkbushell commented 9 years ago

Excellent, thanks for that. Will check shortly then mege in :)