What's the best approach to access related data in CodeIgniter 4? |
As a beginner in CodeIgniter 4 and MVC, I am struggling to design a Model that includes information from two tables - Projects and Hours. I have created a basic Project Model, but I want to include hours associated with each project. I have set up my database using Primary and Foreign Keys, but I am unsure of the best approach to access the hours information.
Should I create a separate Hours Model or add a method to my Project Model that queries the Hours table? What is the recommended best practice for this situation? |
Messages In This Thread |
What's the best approach to access related data in CodeIgniter 4? - by GerishSonya - 04-19-2023, 10:40 PM
RE: What's the best approach to access related data in CodeIgniter 4? - by kenjis - 04-24-2023, 09:51 PM
RE: What's the best approach to access related data in CodeIgniter 4? - by digitalarts - 04-29-2023, 06:54 AM
|