Tharos / LeanMapper

Lean Mapper is a tiny ORM based on powerful Dibi database abstraction library for PHP.
MIT License
87 stars 35 forks source link

Repository: creating entities uses table from parameter #148

Closed leninzprahy closed 5 years ago

leninzprahy commented 5 years ago

Method createEntities have parameter $table, but the primary key retrieval function did not use it. No tests, sorry.

janpecha commented 5 years ago

Ok, thanks! I have question - what's your use-case?

leninzprahy commented 5 years ago

I have two tables (e.g. products and products_category) and I want use only one repository, with shared code.

Otherwise, in the createEntity method, the $table parameter is used to get the primary key, so it will be unified (in methods createEntity and createEntities).

janpecha commented 5 years ago

Ok thanks. Can you please change commit message to:

Repository: creating entities uses table from parameter

Method createEntities have parameter $table, but the primary key retrieval function did not use it.
janpecha commented 5 years ago

Merged as 5e4d1aa1008d62c25707b4dd70c391c9f0020623.