addChildrenCountSelect example

public function getBackendListQuery(array $filterBy = [], array $orderBy = []$limit = null, $offset = null)
    {
        $builder = $this->createQueryBuilder('c');
        $builder->select([
            'c.id as id',
            'c.active as active',
            'c.name as name',
            'c.position as position',
            'c.parentId as parentId',
        ]);

        $builder = $this->addChildrenCountSelect($builder);
        if (!empty($filterBy)) {
            $builder->addFilter($filterBy);
        }

        $builder->addOrderBy('c.parentId');
        $builder->addOrderBy('c.position');
        if (!empty($orderBy)) {
            $builder->addOrderBy($orderBy);
        }

        if ($offset !== null && $limit !== null) {
            
Home | Imprint | This part of the site doesn't use cookies.