Mjoin error

Mjoin error

peterbrownepeterbrowne Posts: 314Questions: 54Answers: 0
edited October 2019 in Editor

Using Mjoin, I have the error:

Parse error: syntax error, unexpected '[' in /var/www/html/curriculum_mapper/datatables/lib/Editor/Join.php on line 762

Using:

 Editor::inst( $db2, 'learning_event', 'learning_event_pk' )    
    ->field(
        Field::inst( 'learning_event.learning_event_name' ),
        Field::inst( 'learning_event.learning_event_outcome' ),
        Field::inst( 'learning_event.rotation_discipline_block_fk' )
            ->options( Options::inst()
                ->table( 'rotation_discipline_block' )
                ->value( 'rotation_discipline_block_pk' )
                ->label( 'rotation_discipline_block_name' )
            ),
        Field::inst( 'rotation_discipline_block.rotation_discipline_block_name' ),
            Field::inst( 'learning_event.rdb_group_fk' )
            ->options( Options::inst()
                ->table( 'rdb_group' )
                ->value( 'rdb_group_pk' )
                ->label( 'rdb_group_name' )
            ),
        Field::inst( 'rdb_group.rdb_group_name' )
    )
    ->leftJoin( 'rotation_discipline_block', 'rotation_discipline_block.rotation_discipline_block_pk', '=', 'learning_event.rotation_discipline_block_fk' )
    ->leftJoin( 'rdb_group', 'rdb_group.rdb_group_pk', '=', 'learning_event.rdb_group_fk' )
    ->join(
        Mjoin::inst( 'presentation' )
            ->link( 'learning_event.learning_event_pk', 'learning_event_presentation_lookup.learning_event_fk' )
            ->link( 'presentation.presentation_pk', 'learning_event_presentation_lookup.presentation_fk' )
            ->order( 'presentation.presentation_name asc' )
            ->fields(
                Field::inst( 'presentation_pk' )
                    ->options( Options::inst()
                        ->table( 'presentation' )
                        ->value( 'presentation_pk' )
                        ->label( 'presentation_name' )                
                    ),
                Field::inst( 'presentation_name' )
            )
    )
    ->join(
        Mjoin::inst( 'mcondition' )
            ->link( 'learning_event.learning_event_pk', 'learning_event_mcondition_lookup.learning_event_fk' )
            ->link( 'mcondition.mcondition_pk', 'learning_event_mcondition_lookup.mcondition_fk' )
            ->order( 'mcondition.mcondition_name asc' )
            ->fields(
                Field::inst( 'mcondition_pk' )
                    ->options( Options::inst()
                        ->table( 'mcondition' )
                        ->value( 'mcondition_pk' )
                        ->label( 'mcondition_name' )          
                    ),
                Field::inst( 'mcondition_name' )
            )
    )
    ->process($_POST)
    ->json();

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.