Trying to do a left join, which I have done in the past OK, but in this instance the fk is not in the parent table 'unit' but the other table 'unit_outcome'
Editor::inst( $db_cm_md, 'unit', 'unit_pk' )
->field(
Field::inst( 'unit.unit_code' ),
Field::inst( 'unit.unit_name' ),
Field::inst( 'unit.points' ),
Field::inst( 'unit.modified' ),
Field::inst( 'unit.modified_by' )->setValue( $user ),
Field::inst( 'unit.year_fk' )
->options( Options::inst()
->table( 'year' )
->value( 'year_pk' )
->label( 'year_name' )
),
Field::inst( 'year.year_name' ),
Field::inst( 'unit_outcome.unit_fk' )
->options( Options::inst()
->table( 'unit_outcome' )
->value( 'unit_outcome_pk' )
->label( 'unit_outcome' )
),
Field::inst( 'unit_outcome.unit_outcome' )
)
->leftJoin( 'year', 'year.year_pk', '=', 'unit.year_fk' )
->leftJoin( 'unit_outcome', 'unit_outcome.unit_outcome_pk', '=', 'unit.unit_fk' )
->process($_POST)
->json();