Ex: we 3 tables:
- teacher table (id, name, sex)
- student table (id, firstname, lastname,sex, dob)
- Emergencycontact table (id, type, refer_id, name, tel, email)
Note: if the type = 1 so the refer_id is teacher id, and type = 2 the refer_id is student id.
How we select the right emergencycontact of teacher, student in the ‘contain’ of find() or get() methods in cakephp 3x?
Thanks for help!