I can't figure out how to add following expression to the views query:
ORDER BY FIELD(field_dataid,3,2,1,4)
QueryPluginBase only gives the option to add:
$query->addOrderBy('node_field_data', 'nid', ASC);
But doesn't give the option to add an expression.
The Sql interface has the options to add an expression:
$query->addExpression('FIELD(node_field_data.nid,3,2,1,4)', 'order_field'); $query->orderBy('order_field', 'ASC');
But this doesn't work with the views query object.
So how can i add orderby expression to the views query object?