sonata-project/SonataDoctrineORMAdminBundle — pull request #28 by rmsint (2011-12-20 16:15:26+00:00)
Title: add alias option for filter

The callback filter could already be used to filter on fields not directly associated to the admin class. The added alias option allows to also use the default filters and requires less code for basic filters.

Example:

```php
// CommentAdmin

protected function configureDatagridFilters(DatagridMapper $mapper)
{
// ...

$query = $this->getDatagrid()->getQuery();
$alias = $query->getRootAlias();

$query
->join("$alias.post", 'p)
->join("$alias.category", 'cat')
;

$mapper
->add('category', 'doctrine_orm_string', array('alias' => 'c', 'field_name' => 'name'))
// ...
;
}
```