Welcome Guest, Not a member yet? Register   Sign In
Using entity with table left join.
#1

Hi,

how to use Codeigniter 4 entity when joined table?




Like example I create two entity

Orders and clients;


in Order table I have client id and I want to join client table, so how it should look like? maybe you can give an example?
Reply
#2

When you join another table, any fields you've selected from that table will be added as a class property to the Entity. You do have to be careful, though, that you don't have fields that overwrite (like id) between the tables because the joined table will likely overwrite the id of the main entity. But that's the same with any SQL join.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB