getFilterQueryBuilder example


    public function getFilterQuery($tokens$offset = null, $limit = null, $orderBy = null)
    {
        $builder = $this->getFilterQueryBuilder($tokens$orderBy);
        if ($offset) {
            $builder->setFirstResult($offset);
        }
        if ($limit) {
            $builder->setMaxResults($limit);
        }

        return $builder->getQuery();
    }

    /** * Returns the basic filter query builder, with all the rules (tokens) applied * * @param array $tokens * @param array $orderBy * * @return QueryBuilder */

    public function getDisplayDateFilterQueryBuilder($categoryIds$filter$shopId = null)
    {
        $builder = $this->getFilterQueryBuilder($categoryIds$filter$shopId);
        $builder->select([
            'DATE_FORMAT(blog.displayDate,\'%Y-%m\') as dateFormatDate',
            'COUNT(DISTINCT blog.id) as dateCount',
        ]);
        $builder->groupBy('dateFormatDate');

        return $builder;
    }

    /** * Returns an instance of the \Doctrine\ORM\Query object which select the blog author filter * * @param int[] $categoryIds * @param array $filter * @param int|null $shopId * * @return Query<Blog> */
Home | Imprint | This part of the site doesn't use cookies.