src/Zicht/Bundle/MessagesBundle/Admin/MessageAdmin.php
public function filteredOnTranslations($queryBuilder, $alias, $field, $value)
    {
        if (!$value['value']) {
            return false;
        }
        
        $queryBuilder->leftJoin(sprintf('%s.translations', $alias), 't');

        $queryBuilder->andWhere(
            $queryBuilder->expr()->orX(
                $queryBuilder->expr()->like('o.message', ':tr'),
                $queryBuilder->expr()->like('t.translation', ':tr')
            )
        );

        $queryBuilder->setParameter('tr', '%' . $value['value'] . '%');

        return true;
    }
public function filteredOnTranslations($queryBuilder, $alias, $field, $value)
    {
        if (!$value['value']) {
            return false;
        }
        
        $queryBuilder->leftJoin(sprintf('%s.translations', $alias), 't');

        $queryBuilder->andWhere(
            $queryBuilder->expr()->orX(
                $queryBuilder->expr()->like('o.message', ':tr'),
                $queryBuilder->expr()->like('t.translation', ':tr')
            )
        );

        $queryBuilder->setParameter('tr', '%' . $value['value'] . '%');

        return true;
    }
public function filteredOnTranslations ( $ queryBuilder , $ alias , $ field , $ value ) { if ( ! $ value [ 'value' ] ) { return false ; } $ queryBuilder -> leftJoin ( sprintf ( '%s.translations' , $ alias ) , 't' ) ; $ queryBuilder -> andWhere ( $ queryBuilder -> expr ( ) -> orX ( $ queryBuilder -> expr ( ) -> like ( 'o.message' , ':tr' ) , $ queryBuilder -> expr ( ) -> like ( 't.translation' , ':tr' ) ) ) ; $ queryBuilder -> setParameter ( 'tr' , '%' . $ value [ 'value' ] . '%' ) ; return true ; }
Custom search handler

Changes the filter behaviour to also search in the message_translation table

@param \Doctrine\ORM\QueryBuilder $queryBuilder
@param string $alias
@param string $field
@param array $value

@return bool
Custom search handler