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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -