mysql - Datamapper ORM- Codeigniter Advance Relationship -
please me understand basic use of datamapper's include_join_fields function. tried lots of not getting results.
i have application $object->include_join_fields()
i have user table , country table.
please me set $hasone=array('country_id'); relation
i haven't idea all, not getting exact point after reading documentation of include_join_fields
any appricate
thanks
include_join_fields
many many relationships, have countries_users
pivot table, , users belong many country.
for example, take 1 user
, , countries
, belongs to. store, how user
related country
. have store extra field in pivot table: countries_users
.
so pivot table, countries_users
this, example field is_he_working_there
:
id country_id user_id is_he_working_there
when make query user's countries, datamapper won't add field default. , here comes include_join_field()
, if call that, datamapper add field end result.
but hasone
, won't take effect, because user, , other table fields also. no pivot table here, don't need include_join_fields()
Comments
Post a Comment