I cannot get sorting entities to work in the admin list of the sonata, here is my entity:
class User extends BaseUser { protected $preferredRegion; }
And here is the definition of configureListFields:
protected function configureListFields(ListMapper $listMapper) { $listMapper->add('preferredRegion', NULL, array('label' => 'Preferred Region', 'sortable' => 'preferredRegion')) }
When you click on the table heading table to sort it by the name of my object, I get this error:
An exception was thrown during template rendering (line [Semantical Error] 0, col 25 next to "AS __order_by": Error: Entity \ User does not have a field or association with the name AS)
How can I make this class work for an object so that it sorts alphabetically by the name of my entity?
thanks
Julian Manser
source share