how to use getFormatter with Mjoin

how to use getFormatter with Mjoin

ziv@kpmbro.comziv@kpmbro.com Posts: 73Questions: 28Answers: 4
edited June 2017 in General

Hi Allan.

I want to add some data to a string on the sever side.
the field is using the Mjoin and i want to combine the result with getFormatter

my code :

                $this->editor_instance->join(
                     Mjoin::inst( '42matters_ios' )
                         ->link( 'offers_main_table.id', '42matters_connection.offer_id' )
                         ->link( '42matters_ios.id', '42matters_connection.42_id')
                         ->order( 'artworkUrl512 asc' )
                         ->fields(
                             Field::inst( 'id' )

                                 ->options( '42matters_ios', 'id', 'artworkUrl512' ),
                             Field::inst( 'artworkUrl512' )->getFormatter( function ( $val ) use ($value) {                             
                                return "xxxx";
                            }));
                         )
                 );


Thanks

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Answer ✓

    That should be all that is needed. Can you show me the JSON that is being returned from the server please?

    Thanks,
    Allan

  • ziv@kpmbro.comziv@kpmbro.com Posts: 73Questions: 28Answers: 4

    no need its working :) thanks Allan.

This discussion has been closed.