tattersoftware / codeigniter4-relations

Entity relationships for CodeIgniter 4
MIT License
87 stars 20 forks source link

make sure magic calls on entity find the correct table name #50

Closed mkuettel closed 2 months ago

mkuettel commented 6 months ago

I had two tables called pages and page_contents.

Beforehand when calling for example $page->hasPageContents() on a Page Entity then the library looks for the database wrong table pageContents because __call doesn't translate the method name from camelCase to snake_case.

This commit fixes this that the snake-case table names such as page_contents get found.