Select only distinct values as Editor options?

Select only distinct values as Editor options?

CapamaniaCapamania Posts: 229Questions: 79Answers: 5
edited April 2017 in Editor

Is there a way to select only 'distinct' values as options for the Editor Options values?

Field::inst( 'contacts.department' )
            ->options( Options::inst()
                ->table( 'dept' )
                ->value( 'name' )
                ->label( 'name' )
                ->order( 'name DESC' )
                ->distinct( 'name' )
                //->where( function ($q) {
                //    $q->where( 'name', 'L%', 'LIKE' );
                //}                
            ),

https://editor.datatables.net/manual/php/joins

This discussion has been closed.