analogueorm / analogue

Analogue ORM : Data Mapper ORM for Laravel/PHP
MIT License
635 stars 52 forks source link

Is it possible to have properties of entity in camelCase, but fields in DB are in snake_case? #263

Closed dajnz closed 5 years ago

dajnz commented 6 years ago

Is this auto mapping between names possible?

RemiCollin commented 6 years ago

This is not possible yet, but having control on the attributes/properties name when hydrating/dehydrating entities would be a really good feature. I'd gladly accept a PR regarding this.

adrorocker commented 5 years ago

I made a PR [#275] that make this possible @RemiCollin can you take a look at it when possible?

Thanks 😃

adrorocker commented 5 years ago

@dajnz This is now possible if you set $camelCaseHydratation to true on the entity map just like :

protected $camelCaseHydratation = true;

Late, but hope this help you.