@@ -159,6 +159,11 @@ class Datagrid implements DatagridInterface
return $this->filters;
}
+ public function reorderFilters(array $keys)
+ {
+ $this->filters = array_merge(array_flip($keys), $this->filters);
+ }
+
/**
* @return array
*/
@@ -110,4 +110,15 @@ class DatagridMapper
return $this;
+ /**
+ * @param array $keys field names
+ * @return \Sonata\AdminBundle\Datagrid\ListMapper
+ */
+ public function reorder(array $keys)
+ $this->datagrid->reorderFilters($keys);
+ return $this;