$this->child_relations = array();
// parent relationship details
$this->parent_relations[] = array('parent' => 'branch',
'parent_field' => 'branch_id, branch_desc, branch_abbrev, syllabus_type_id, student_branch_abbrev, crf_type_id, session_type_id as branch_session_type_id',
'fields' => array('branch_id' => 'branch_id'));
$this->parent_relations[] = array('parent' => 'candidate',
'parent_field' => 'concat(first_name, \' \', last_name) as person_name, age_group_id, dob_date, first_name, last_name, gender, candidate_pin, student_ind, addr_line_1, addr_line_2, addr_line_3, town, county, postcode, email_addr, home_telephone, mobile_telephone',
'fields' => array('candidate_id' => 'candidate_id',
'rdcaccount_id' => 'rdcaccount_id'));
$this->parent_relations[] = array('parent' => 'dance',
'alias' => 'd1',
'parent_field' => 'dance_code as dance1_code',
'fields' => array('dance1_id' => 'dance_id'));
$this->parent_relations[] = array('parent' => 'dance',
'alias' => 'd2',
'parent_field' => 'dance_code as dance2_code',
'fields' => array('dance2_id' => 'dance_id'));
$this->parent_relations[] = array('parent' => 'dance',
'alias' => 'd3',
'parent_field' => 'dance_code as dance3_code',
'fields' => array('dance3_id' => 'dance_id'));
$this->parent_relations[] = array('parent' => 'dance',
'alias' => 'd4',
'parent_field' => 'dance_code as dance4_code',
'fields' => array('dance4_id' => 'dance_id'));
$this->parent_relations[] = array('parent' => 'grade',
'parent_field' => 'grade_code, grade_desc',
'fields' => array('grade_id' => 'grade_id'));
$this->parent_relations[] = array('parent' => 'school',
'parent_field' => 'school_name, principal_name, principal_mem_num, school_addr_line_1, school_addr_line_2, school_addr_line_3, school_town, school_county, school_postcode, school_email_addr, school_web_addr, school_telephone',
'fields' => array('rdcaccount_id' => 'rdcaccount_id',
'rdcaccount_id' => 'school_id'));
$this->parent_relations[] = array('parent' => 'session',
'parent_field' => 'session_desc, session_date, examiner, session_type_id',
'fields' => array('rdcaccount_id' => 'rdcaccount_id',
'session_id' => 'session_id'));