cakephp/cakephp — pull request #3161 by dereuromark (2014-03-29 15:27:25+00:00)
Title: Allow Association to define foreign keys and properties DRY

Allow Association objects to define in a more DRY approach how the foreign_key_id/foreignKeyId fields and all field properties are generated.
Especially regarding the use of camelBacked vs under_scored.

### Basis
If one would want to use camelBacked for table fields including foreign key fields, it is currently difficult to achieve.
One could use the Entitiy::set/get to map those underscored fields into camelBacked properties of the Entity classes. But it would be consistent if the ORM would be able to resolve this internally and both code and DB use the same type of field naming scheme.

So $UserEntity->someForeignKey maps to "someForeignKey" of the "users" table then.

Since the whole framework uses camelBacked options/settings keys it would also make DB driven settings and merging them with Configure settings way easier and uniform (as of right now Inflection would be needed).

### Implementation
This PR uses a generic _generateKey() method to reduce the redundancy in the code as well as allowing the _camelBack property to define what scheme should be used as default one.

### Outview
This might need more adjustments in the other parts of the ORM, framework to be a fully working "camelBack" standard instead of the former "under_scored" one.

If this approach sounds sane, I can also add some tests.