Skip to content

Conversation

@rufinus
Copy link

@rufinus rufinus commented Jan 12, 2016

needs testing with dffierent usecases.

my use case was:

    public function buildTable(TableBuilderInterface $builder, array $options)
    {
        // [...]
        $builder->add('fields', 'text', array(
            'params' => array('GROUP_CONCAT(f.name SEPARATOR \', \')'),
            'title'  => 'Options',
            'allow_sort' => true,
            'allow_filter' => true,
        ))
        // [..]
    }

    public function getQueryBuilder(ObjectManager $entityManager, array $params)
    {
        $qb = $entityManager
            ->getRepository('Model:CustomField')
            ->createQueryBuilder('c')
            ->leftJoin('c.fields', 'f')
            ->leftJoin('c.parent', 'p')
            ->where('p is null')
            ->groupBy('c.id');

        return $qb;
    }

…ifferent usecases.

my use case was:

```
    public function buildTable(TableBuilderInterface $builder, array $options)
    {
        // [...]
        $builder->add('fields', 'text', array(
            'params' => array('GROUP_CONCAT(f.name SEPARATOR \', \')'),
            'title'  => 'Options',
            'allow_sort' => true,
            'allow_filter' => true,
        ))
        // [..]
    }

    public function getQueryBuilder(ObjectManager $entityManager, array $params)
    {
        $qb = $entityManager
            ->getRepository('Model:CustomField')
            ->createQueryBuilder('c')
            ->leftJoin('c.fields', 'f')
            ->leftJoin('c.parent', 'p')
            ->where('p is null')
            ->groupBy('c.id');

        return $qb;
    }
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant